| 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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection,
oldSelectionRect, newSelectionRect); | 1333 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection,
oldSelectionRect, newSelectionRect); |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta
iner) | 1336 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
tate& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationConta
iner) |
| 1337 { | 1337 { |
| 1338 LayoutView* v = view(); | 1338 LayoutView* v = view(); |
| 1339 if (v->document().printing()) | 1339 if (v->document().printing()) |
| 1340 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. | 1340 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. |
| 1341 | 1341 |
| 1342 const LayoutRect oldBounds = previousPaintInvalidationRect(); | 1342 const LayoutRect oldBounds = previousPaintInvalidationRect(); |
| 1343 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabl
ed() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); | 1343 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintOffsetC
achingEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking()
; |
| 1344 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont
ainer, &paintInvalidationState); | 1344 LayoutRect newBounds = boundsRectForPaintInvalidation(&paintInvalidationCont
ainer, &paintInvalidationState); |
| 1345 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabled() ?
LayoutPoint() : DeprecatedPaintLayer::positionFromPaintInvalidationBacking(this
, &paintInvalidationContainer, &paintInvalidationState); | 1345 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintOffsetCaching
Enabled() ? LayoutPoint() : DeprecatedPaintLayer::positionFromPaintInvalidationB
acking(this, &paintInvalidationContainer, &paintInvalidationState); |
| 1346 | 1346 |
| 1347 // Composited scrolling should not be included in the bounds and position tr
acking, because the graphics layer backing the scroller | 1347 // Composited scrolling should not be included in the bounds and position tr
acking, because the graphics layer backing the scroller |
| 1348 // does not move on scroll. | 1348 // does not move on scroll. |
| 1349 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { | 1349 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { |
| 1350 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); | 1350 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); |
| 1351 newLocation.move(inverseOffset); | 1351 newLocation.move(inverseOffset); |
| 1352 newBounds.move(inverseOffset); | 1352 newBounds.move(inverseOffset); |
| 1353 } | 1353 } |
| 1354 | 1354 |
| 1355 setPreviousPaintInvalidationRect(newBounds); | 1355 setPreviousPaintInvalidationRect(newBounds); |
| 1356 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 1356 if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()) |
| 1357 setPreviousPositionFromPaintInvalidationBacking(newLocation); | 1357 setPreviousPositionFromPaintInvalidationBacking(newLocation); |
| 1358 | 1358 |
| 1359 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1359 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); |
| 1360 | 1360 |
| 1361 // We need to invalidate the selection before checking for whether we are do
ing a full invalidation. | 1361 // We need to invalidate the selection before checking for whether we are do
ing a full invalidation. |
| 1362 // This is because we need to update the old rect regardless. | 1362 // This is because we need to update the old rect regardless. |
| 1363 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); | 1363 invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason); |
| 1364 | 1364 |
| 1365 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", | 1365 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", |
| 1366 "object", this->debugName().ascii(), | 1366 "object", this->debugName().ascii(), |
| 1367 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); | 1367 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); |
| 1368 | 1368 |
| 1369 bool boxDecorationBackgroundObscured = boxDecorationBackgroundIsKnownToBeObs
cured(); | 1369 bool boxDecorationBackgroundObscured = boxDecorationBackgroundIsKnownToBeObs
cured(); |
| 1370 if (!isFullPaintInvalidationReason(invalidationReason) && boxDecorationBackg
roundObscured != m_bitfields.lastBoxDecorationBackgroundObscured()) | 1370 if (!isFullPaintInvalidationReason(invalidationReason) && boxDecorationBackg
roundObscured != m_bitfields.lastBoxDecorationBackgroundObscured()) |
| 1371 invalidationReason = PaintInvalidationBackgroundObscurationChange; | 1371 invalidationReason = PaintInvalidationBackgroundObscurationChange; |
| 1372 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb
scured); | 1372 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb
scured); |
| 1373 | 1373 |
| 1374 if (invalidationReason == PaintInvalidationNone) { | 1374 if (invalidationReason == PaintInvalidationNone) { |
| 1375 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. | 1375 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. |
| 1376 // There are corner cases that the display items need to be invalidated
for paint offset | 1376 // There are corner cases that the display items need to be invalidated
for paint offset |
| 1377 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based | 1377 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based |
| 1378 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. | 1378 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. |
| 1379 // This is a workaround to force display items to update paint offset. | 1379 // This is a workaround to force display items to update paint offset. |
| 1380 if (paintInvalidationState.forcedSubtreeInvalidationWithinContainer()) | 1380 if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && pain
tInvalidationState.forcedSubtreeInvalidationWithinContainer()) |
| 1381 invalidateDisplayItemClients(paintInvalidationContainer); | 1381 invalidateDisplayItemClients(paintInvalidationContainer); |
| 1382 | 1382 |
| 1383 return invalidationReason; | 1383 return invalidationReason; |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 invalidateDisplayItemClients(paintInvalidationContainer); | 1386 invalidateDisplayItemClients(paintInvalidationContainer); |
| 1387 | 1387 |
| 1388 if (invalidationReason == PaintInvalidationIncremental) { | 1388 if (invalidationReason == PaintInvalidationIncremental) { |
| 1389 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds, newLocation); | 1389 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds, newLocation); |
| 1390 return invalidationReason; | 1390 return invalidationReason; |
| (...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3391 const blink::LayoutObject* root = object1; | 3391 const blink::LayoutObject* root = object1; |
| 3392 while (root->parent()) | 3392 while (root->parent()) |
| 3393 root = root->parent(); | 3393 root = root->parent(); |
| 3394 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3394 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3395 } else { | 3395 } else { |
| 3396 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3396 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3397 } | 3397 } |
| 3398 } | 3398 } |
| 3399 | 3399 |
| 3400 #endif | 3400 #endif |
| OLD | NEW |