Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qbackingstore.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    264264    const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft()));
    265265    const QRect tlwRect(QRect(pos, rect.size()));
    266     if (dirty.intersects(tlwRect))
     266    if (dirty.intersects(tlwRect))
    267267        return false; // We don't want to scroll junk.
    268268    return windowSurface->scroll(tlwRect, dx, dy);
     
    353353    dirtyOnScreen += toClean;
    354354
    355 #ifdef Q_WS_QWS
     355#if
    356356    toClean.translate(tlwOffset);
    357357#endif
     
    403403    const QRect tlwRect(topLevelRect());
    404404    const QRect surfaceGeometry(windowSurface->geometry());
    405     if (surfaceGeometry != tlwRect && surfaceGeometry.size() != tlwRect.size()) {
     405    if ()) {
    406406        if (widgetDirty) {
    407407            const QRect dirtyTlwRect = QRect(QPoint(), tlwRect.size());
     
    447447/*!
    448448    Returns the static content inside the \a parent if non-zero; otherwise the static content
    449     for the entire backing store is returned. The content will be clipped to \a withingClipRect
     449    for the entire backing store is returned. The content will be clipped to \a withinClipRect
    450450    if non-empty.
    451451*/
     
    553553        if (!eventAlreadyPosted || updateImmediately)
    554554            sendUpdateRequest(widget, updateImmediately);
     555
     556
     557
     558
     559
     560
     561
     562
     563
     564
     565
     566
    555567        return;
    556568    }
     
    639651    }
    640652
     653
     654
     655
     656
     657
     658
     659
     660
     661
     662
     663
     664
    641665    const QRect widgetRect = widget->d_func()->effectiveRectFor(rect);
    642666    const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint())));
     
    834858QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel)
    835859    : tlw(topLevel), dirtyOnScreenWidgets(0), hasDirtyFromPreviousSync(false)
     860
    836861{
    837862    windowSurface = tlw->windowSurface();
     
    885910    QRect clipR(pd->clipRect());
    886911#ifdef Q_WS_QWS
    887     QWidgetBackingStore *wbs = x->backingStore;
     912    QWidgetBackingStore *wbs = x->backingStore;
    888913    QWSWindowSurface *surface = static_cast<QWSWindowSurface*>(wbs->windowSurface);
    889914    clipR = clipR.intersected(surface->clipRegion().translated(-toplevelOffset).boundingRect());
     
    915940    } else {
    916941
    917         QWidgetBackingStore *wbs = x->backingStore;
     942        QWidgetBackingStore *wbs = x->backingStore;
    918943        QRegion childExpose(newRect & clipR);
    919944
     
    958983        return;
    959984
    960     QWidgetBackingStore *wbs = x->backingStore;
     985    QWidgetBackingStore *wbs = x->backingStore;
    961986    if (!wbs)
    962987        return;
     
    11231148                resetWidget(dirtyWidgets.at(i));
    11241149            dirtyWidgets.clear();
     1150
    11251151        }
    11261152        return;
     
    11331159    bool repaintAllWidgets = false;
    11341160
    1135     if (inTopLevelResize || surfaceGeometry != tlwRect) {
    1136         if ((inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
    1137             if (hasStaticContents()) {
    1138                 // Repaint existing dirty area and newly visible area.
    1139                 const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
    1140                 const QRegion staticRegion(staticContents(0, clipRect));
    1141                 QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height());
    1142                 newVisible -= staticRegion;
    1143                 dirty += newVisible;
    1144                 windowSurface->setStaticContents(staticRegion);
    1145             } else {
    1146                 // Repaint everything.
    1147                 dirty = QRegion(0, 0, tlwRect.width(), tlwRect.height());
    1148                 for (int i = 0; i < dirtyWidgets.size(); ++i)
    1149                     resetWidget(dirtyWidgets.at(i));
    1150                 dirtyWidgets.clear();
    1151                 repaintAllWidgets = true;
    1152             }
    1153         }
     1161    if ((fullUpdatePending || inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
     1162        if (hasStaticContents()) {
     1163            // Repaint existing dirty area and newly visible area.
     1164            const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
     1165            const QRegion staticRegion(staticContents(0, clipRect));
     1166            QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height());
     1167            newVisible -= staticRegion;
     1168            dirty += newVisible;
     1169            windowSurface->setStaticContents(staticRegion);
     1170        } else {
     1171            // Repaint everything.
     1172            dirty = QRegion(0, 0, tlwRect.width(), tlwRect.height());
     1173            for (int i = 0; i < dirtyWidgets.size(); ++i)
     1174                resetWidget(dirtyWidgets.at(i));
     1175            dirtyWidgets.clear();
     1176            repaintAllWidgets = true;
     1177        }
     1178    }
     1179
     1180    if (inTopLevelResize || surfaceGeometry != tlwRect)
    11541181        windowSurface->setGeometry(tlwRect);
    1155     }
    11561182
    11571183    if (updatesDisabled)
     
    12131239    dirtyWidgets.clear();
    12141240
     1241
     1242
    12151243    if (toClean.isEmpty()) {
    12161244        // Nothing to repaint. However, we might have newly exposed areas on the
     
    12671295        QWindowSurface *subSurface = w->windowSurface();
    12681296        BeginPaintInfo beginPaintInfo;
    1269         beginPaint(toBePainted, w, subSurface, &beginPaintInfo, false);
     1297
     1298        QPoint off = w->mapTo(tlw, QPoint());
     1299        toBePainted.translate(off);
     1300        beginPaint(toBePainted, w, subSurface, &beginPaintInfo, true);
     1301        toBePainted.translate(-off);
     1302
    12701303        if (beginPaintInfo.nothingToPaint)
    12711304            continue;
Note: See TracChangeset for help on using the changeset viewer.