OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1191 // This is valid because we want to invalidate the client in the display item list of the current backing. | 1191 // This is valid because we want to invalidate the client in the display item list of the current backing. |
1192 DisableCompositingQueryAsserts disabler; | 1192 DisableCompositingQueryAsserts disabler; |
1193 if (const DeprecatedPaintLayer* paintInvalidationLayer = enclosingLayer- >enclosingLayerForPaintInvalidationCrossingFrameBoundaries()) | 1193 if (const DeprecatedPaintLayer* paintInvalidationLayer = enclosingLayer- >enclosingLayerForPaintInvalidationCrossingFrameBoundaries()) |
1194 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient); | 1194 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient); |
1195 } | 1195 } |
1196 } | 1196 } |
1197 | 1197 |
1198 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const | 1198 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const |
1199 { | 1199 { |
1200 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this); | 1200 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this); |
1201 | |
1202 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
pdr.
2015/09/15 03:03:59
Restoring this (instead of the setNeedsRepaint bel
| |
1203 if (DeprecatedPaintLayer* enclosingLayer = this->enclosingLayer()) | |
1204 enclosingLayer->setNeedsRepaint(); | |
1205 } | |
1206 } | 1201 } |
1207 | 1202 |
1208 LayoutRect LayoutObject::boundsRectForPaintInvalidation(const LayoutBoxModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const | 1203 LayoutRect LayoutObject::boundsRectForPaintInvalidation(const LayoutBoxModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const |
1209 { | 1204 { |
1210 if (!paintInvalidationContainer) | 1205 if (!paintInvalidationContainer) |
1211 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); | 1206 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); |
1212 return DeprecatedPaintLayer::computePaintInvalidationRect(this, paintInvalid ationContainer->layer(), paintInvalidationState); | 1207 return DeprecatedPaintLayer::computePaintInvalidationRect(this, paintInvalid ationContainer->layer(), paintInvalidationState); |
1213 } | 1208 } |
1214 | 1209 |
1215 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& r) const | 1210 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& r) const |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1329 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, newSelectionRect); | 1324 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, newSelectionRect); |
1330 } | 1325 } |
1331 | 1326 |
1332 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta iner) | 1327 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta iner) |
1333 { | 1328 { |
1334 LayoutView* v = view(); | 1329 LayoutView* v = view(); |
1335 if (v->document().printing()) | 1330 if (v->document().printing()) |
1336 return PaintInvalidationNone; // Don't invalidate paints if we're printi ng. | 1331 return PaintInvalidationNone; // Don't invalidate paints if we're printi ng. |
1337 | 1332 |
1338 const LayoutRect oldBounds = previousPaintInvalidationRect(); | 1333 const LayoutRect oldBounds = previousPaintInvalidationRect(); |
1339 const LayoutPoint oldLocation = previousPositionFromPaintInvalidationBacking (); | 1334 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabl ed() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); |
1340 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont ainer, &paintInvalidationState); | 1335 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont ainer, &paintInvalidationState); |
1341 LayoutPoint newLocation = DeprecatedPaintLayer::positionFromPaintInvalidatio nBacking(this, &paintInvalidationContainer, &paintInvalidationState); | 1336 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabled() ? LayoutPoint() : DeprecatedPaintLayer::positionFromPaintInvalidationBacking(this , &paintInvalidationContainer, &paintInvalidationState); |
1342 | 1337 |
1343 // Composited scrolling should not be included in the bounds and position tr acking, because the graphics layer backing the scroller | 1338 // Composited scrolling should not be included in the bounds and position tr acking, because the graphics layer backing the scroller |
1344 // does not move on scroll. | 1339 // does not move on scroll. |
1345 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati onContainer != this) { | 1340 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati onContainer != this) { |
1346 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); | 1341 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); |
1347 newLocation.move(inverseOffset); | 1342 newLocation.move(inverseOffset); |
1348 newBounds.move(inverseOffset); | 1343 newBounds.move(inverseOffset); |
1349 } | 1344 } |
1350 | 1345 |
1351 setPreviousPaintInvalidationRect(newBounds); | 1346 setPreviousPaintInvalidationRect(newBounds); |
1352 setPreviousPositionFromPaintInvalidationBacking(newLocation); | 1347 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
1348 setPreviousPositionFromPaintInvalidationBacking(newLocation); | |
1353 | 1349 |
1354 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn validationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1350 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn validationContainer, oldBounds, oldLocation, newBounds, newLocation); |
1355 | 1351 |
1356 // We need to invalidate the selection before checking for whether we are do ing a full invalidation. | 1352 // We need to invalidate the selection before checking for whether we are do ing a full invalidation. |
1357 // This is because we need to update the old rect regardless. | 1353 // This is because we need to update the old rect regardless. |
1358 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); | 1354 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); |
1359 | 1355 |
1360 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject: :invalidatePaintIfNeeded()", | 1356 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject: :invalidatePaintIfNeeded()", |
1361 "object", this->debugName().ascii(), | 1357 "object", this->debugName().ascii(), |
1362 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n ewLocation)); | 1358 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n ewLocation)); |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3133 return PaintInvalidationForcedByLayout; | 3129 return PaintInvalidationForcedByLayout; |
3134 case DocumentLifecycle::InCompositingUpdate: | 3130 case DocumentLifecycle::InCompositingUpdate: |
3135 return PaintInvalidationCompositingUpdate; | 3131 return PaintInvalidationCompositingUpdate; |
3136 default: | 3132 default: |
3137 return PaintInvalidationFull; | 3133 return PaintInvalidationFull; |
3138 } | 3134 } |
3139 } | 3135 } |
3140 | 3136 |
3141 inline void LayoutObject::markContainerChainForPaintInvalidation() | 3137 inline void LayoutObject::markContainerChainForPaintInvalidation() |
3142 { | 3138 { |
3139 // Setting layer-needs-repaint doesn't mean we'll fully repaint the layer, b ut | |
3140 // means we won't skip painting of the whole layer with a CachedSubsequenceD isplayItem. | |
3141 // This is to ensure we'll check paint offset changes of the objects on the layer. | |
3142 // We'll still use cached display items for non-invalidated objects on the l ayer. | |
3143 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | |
3144 if (DeprecatedPaintLayer* enclosingLayer = this->enclosingLayer()) | |
3145 enclosingLayer->setNeedsRepaint(); | |
3146 } | |
3147 | |
3143 for (LayoutObject* container = this->containerCrossingFrameBoundaries(); con tainer && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidati onState(); container = container->containerCrossingFrameBoundaries()) | 3148 for (LayoutObject* container = this->containerCrossingFrameBoundaries(); con tainer && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidati onState(); container = container->containerCrossingFrameBoundaries()) |
3144 container->m_bitfields.setChildShouldCheckForPaintInvalidation(true); | 3149 container->m_bitfields.setChildShouldCheckForPaintInvalidation(true); |
3145 } | 3150 } |
3146 | 3151 |
3147 void LayoutObject::setShouldInvalidateSelection() | 3152 void LayoutObject::setShouldInvalidateSelection() |
3148 { | 3153 { |
3149 if (!canUpdateSelectionOnRootLineBoxes()) | 3154 if (!canUpdateSelectionOnRootLineBoxes()) |
3150 return; | 3155 return; |
3151 | 3156 |
3152 m_bitfields.setShouldInvalidateSelection(true); | 3157 m_bitfields.setShouldInvalidateSelection(true); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3388 const blink::LayoutObject* root = object1; | 3393 const blink::LayoutObject* root = object1; |
3389 while (root->parent()) | 3394 while (root->parent()) |
3390 root = root->parent(); | 3395 root = root->parent(); |
3391 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3396 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3392 } else { | 3397 } else { |
3393 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3398 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3394 } | 3399 } |
3395 } | 3400 } |
3396 | 3401 |
3397 #endif | 3402 #endif |
OLD | NEW |