Changeset 846 for trunk/src/gui/painting/qbackingstore.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qbackingstore.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 264 264 const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft())); 265 265 const QRect tlwRect(QRect(pos, rect.size())); 266 if ( dirty.intersects(tlwRect))266 if (fullUpdatePending || dirty.intersects(tlwRect)) 267 267 return false; // We don't want to scroll junk. 268 268 return windowSurface->scroll(tlwRect, dx, dy); … … 353 353 dirtyOnScreen += toClean; 354 354 355 #if def Q_WS_QWS355 #if defined(Q_WS_QWS) && !defined(Q_BACKINGSTORE_SUBSURFACES) 356 356 toClean.translate(tlwOffset); 357 357 #endif … … 403 403 const QRect tlwRect(topLevelRect()); 404 404 const QRect surfaceGeometry(windowSurface->geometry()); 405 if ( surfaceGeometry != tlwRect && surfaceGeometry.size() != tlwRect.size()) {405 if (fullUpdatePending || (surfaceGeometry != tlwRect && surfaceGeometry.size() != tlwRect.size())) { 406 406 if (widgetDirty) { 407 407 const QRect dirtyTlwRect = QRect(QPoint(), tlwRect.size()); … … 447 447 /*! 448 448 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 within gClipRect449 for the entire backing store is returned. The content will be clipped to \a withinClipRect 450 450 if non-empty. 451 451 */ … … 553 553 if (!eventAlreadyPosted || updateImmediately) 554 554 sendUpdateRequest(widget, updateImmediately); 555 return; 556 } 557 558 if (fullUpdatePending) { 559 if (updateImmediately) 560 sendUpdateRequest(tlw, updateImmediately); 561 return; 562 } 563 564 if (!windowSurface->hasPartialUpdateSupport()) { 565 fullUpdatePending = true; 566 sendUpdateRequest(tlw, updateImmediately); 555 567 return; 556 568 } … … 639 651 } 640 652 653 if (fullUpdatePending) { 654 if (updateImmediately) 655 sendUpdateRequest(tlw, updateImmediately); 656 return; 657 } 658 659 if (!windowSurface->hasPartialUpdateSupport()) { 660 fullUpdatePending = true; 661 sendUpdateRequest(tlw, updateImmediately); 662 return; 663 } 664 641 665 const QRect widgetRect = widget->d_func()->effectiveRectFor(rect); 642 666 const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint()))); … … 834 858 QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel) 835 859 : tlw(topLevel), dirtyOnScreenWidgets(0), hasDirtyFromPreviousSync(false) 860 , fullUpdatePending(0) 836 861 { 837 862 windowSurface = tlw->windowSurface(); … … 885 910 QRect clipR(pd->clipRect()); 886 911 #ifdef Q_WS_QWS 887 QWidgetBackingStore *wbs = x->backingStore ;912 QWidgetBackingStore *wbs = x->backingStore.data(); 888 913 QWSWindowSurface *surface = static_cast<QWSWindowSurface*>(wbs->windowSurface); 889 914 clipR = clipR.intersected(surface->clipRegion().translated(-toplevelOffset).boundingRect()); … … 915 940 } else { 916 941 917 QWidgetBackingStore *wbs = x->backingStore ;942 QWidgetBackingStore *wbs = x->backingStore.data(); 918 943 QRegion childExpose(newRect & clipR); 919 944 … … 958 983 return; 959 984 960 QWidgetBackingStore *wbs = x->backingStore ;985 QWidgetBackingStore *wbs = x->backingStore.data(); 961 986 if (!wbs) 962 987 return; … … 1123 1148 resetWidget(dirtyWidgets.at(i)); 1124 1149 dirtyWidgets.clear(); 1150 fullUpdatePending = false; 1125 1151 } 1126 1152 return; … … 1133 1159 bool repaintAllWidgets = false; 1134 1160 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) 1154 1181 windowSurface->setGeometry(tlwRect); 1155 }1156 1182 1157 1183 if (updatesDisabled) … … 1213 1239 dirtyWidgets.clear(); 1214 1240 1241 fullUpdatePending = false; 1242 1215 1243 if (toClean.isEmpty()) { 1216 1244 // Nothing to repaint. However, we might have newly exposed areas on the … … 1267 1295 QWindowSurface *subSurface = w->windowSurface(); 1268 1296 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 1270 1303 if (beginPaintInfo.nothingToPaint) 1271 1304 continue;
Note:
See TracChangeset
for help on using the changeset viewer.