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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection,
oldSelectionRect, newSelectionRect); | 1329 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection,
oldSelectionRect, newSelectionRect); |
1330 } | 1330 } |
1331 | 1331 |
1332 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta
iner) | 1332 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta
iner) |
1333 { | 1333 { |
1334 LayoutView* v = view(); | 1334 LayoutView* v = view(); |
1335 if (v->document().printing()) | 1335 if (v->document().printing()) |
1336 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. | 1336 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. |
1337 | 1337 |
1338 const LayoutRect oldBounds = previousPaintInvalidationRect(); | 1338 const LayoutRect oldBounds = previousPaintInvalidationRect(); |
1339 const LayoutPoint oldLocation = previousPositionFromPaintInvalidationBacking
(); | 1339 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabl
ed() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); |
1340 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont
ainer, &paintInvalidationState); | 1340 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont
ainer, &paintInvalidationState); |
1341 LayoutPoint newLocation = DeprecatedPaintLayer::positionFromPaintInvalidatio
nBacking(this, &paintInvalidationContainer, &paintInvalidationState); | 1341 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabled() ?
LayoutPoint() : DeprecatedPaintLayer::positionFromPaintInvalidationBacking(this
, &paintInvalidationContainer, &paintInvalidationState); |
1342 | 1342 |
1343 // Composited scrolling should not be included in the bounds and position tr
acking, because the graphics layer backing the scroller | 1343 // 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. | 1344 // does not move on scroll. |
1345 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { | 1345 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { |
1346 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); | 1346 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); |
1347 newLocation.move(inverseOffset); | 1347 newLocation.move(inverseOffset); |
1348 newBounds.move(inverseOffset); | 1348 newBounds.move(inverseOffset); |
1349 } | 1349 } |
1350 | 1350 |
1351 setPreviousPaintInvalidationRect(newBounds); | 1351 setPreviousPaintInvalidationRect(newBounds); |
1352 setPreviousPositionFromPaintInvalidationBacking(newLocation); | 1352 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 1353 setPreviousPositionFromPaintInvalidationBacking(newLocation); |
1353 | 1354 |
1354 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1355 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); |
1355 | 1356 |
1356 // We need to invalidate the selection before checking for whether we are do
ing a full invalidation. | 1357 // 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. | 1358 // This is because we need to update the old rect regardless. |
1358 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); | 1359 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); |
1359 | 1360 |
1360 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", | 1361 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", |
1361 "object", this->debugName().ascii(), | 1362 "object", this->debugName().ascii(), |
1362 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); | 1363 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 return PaintInvalidationForcedByLayout; | 3125 return PaintInvalidationForcedByLayout; |
3125 case DocumentLifecycle::InCompositingUpdate: | 3126 case DocumentLifecycle::InCompositingUpdate: |
3126 return PaintInvalidationCompositingUpdate; | 3127 return PaintInvalidationCompositingUpdate; |
3127 default: | 3128 default: |
3128 return PaintInvalidationFull; | 3129 return PaintInvalidationFull; |
3129 } | 3130 } |
3130 } | 3131 } |
3131 | 3132 |
3132 inline void LayoutObject::markContainerChainForPaintInvalidation() | 3133 inline void LayoutObject::markContainerChainForPaintInvalidation() |
3133 { | 3134 { |
| 3135 // Setting layer-needs-repaint doesn't mean we'll fully repaint the layer, b
ut |
| 3136 // means we won't skip painting of the whole layer with a CachedSubsequenceD
isplayItem. |
| 3137 // This is to ensure we'll check paint offset changes of the objects on the
layer. |
| 3138 // We'll still use cached display items for non-invalidated objects on the l
ayer. |
| 3139 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 3140 if (DeprecatedPaintLayer* enclosingLayer = this->enclosingLayer()) |
| 3141 enclosingLayer->setNeedsRepaint(); |
| 3142 } |
| 3143 |
3134 for (LayoutObject* container = this->containerCrossingFrameBoundaries(); con
tainer && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidati
onState(); container = container->containerCrossingFrameBoundaries()) | 3144 for (LayoutObject* container = this->containerCrossingFrameBoundaries(); con
tainer && !container->shouldCheckForPaintInvalidationRegardlessOfPaintInvalidati
onState(); container = container->containerCrossingFrameBoundaries()) |
3135 container->m_bitfields.setChildShouldCheckForPaintInvalidation(true); | 3145 container->m_bitfields.setChildShouldCheckForPaintInvalidation(true); |
3136 } | 3146 } |
3137 | 3147 |
3138 void LayoutObject::setShouldInvalidateSelection() | 3148 void LayoutObject::setShouldInvalidateSelection() |
3139 { | 3149 { |
3140 if (!canUpdateSelectionOnRootLineBoxes()) | 3150 if (!canUpdateSelectionOnRootLineBoxes()) |
3141 return; | 3151 return; |
3142 | 3152 |
3143 m_bitfields.setShouldInvalidateSelection(true); | 3153 m_bitfields.setShouldInvalidateSelection(true); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 const blink::LayoutObject* root = object1; | 3389 const blink::LayoutObject* root = object1; |
3380 while (root->parent()) | 3390 while (root->parent()) |
3381 root = root->parent(); | 3391 root = root->parent(); |
3382 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3392 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3383 } else { | 3393 } else { |
3384 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3394 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3385 } | 3395 } |
3386 } | 3396 } |
3387 | 3397 |
3388 #endif | 3398 #endif |
OLD | NEW |