| 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 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 | 1389 |
| 1390 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", | 1390 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", |
| 1391 "object", this->debugName().ascii(), | 1391 "object", this->debugName().ascii(), |
| 1392 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); | 1392 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); |
| 1393 | 1393 |
| 1394 bool backgroundObscured = backgroundIsKnownToBeObscured(); | 1394 bool backgroundObscured = backgroundIsKnownToBeObscured(); |
| 1395 if (!isFullPaintInvalidationReason(invalidationReason) && backgroundObscured
!= m_bitfields.previousBackgroundObscured()) | 1395 if (!isFullPaintInvalidationReason(invalidationReason) && backgroundObscured
!= m_bitfields.previousBackgroundObscured()) |
| 1396 invalidationReason = PaintInvalidationBackgroundObscurationChange; | 1396 invalidationReason = PaintInvalidationBackgroundObscurationChange; |
| 1397 m_bitfields.setPreviousBackgroundObscured(backgroundObscured); | 1397 m_bitfields.setPreviousBackgroundObscured(backgroundObscured); |
| 1398 | 1398 |
| 1399 if (invalidationReason == PaintInvalidationNone) { | 1399 if (invalidationReason == PaintInvalidationNone || invalidationReason == Pai
ntInvalidationDelayedFull) { |
| 1400 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. | 1400 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. |
| 1401 // There are corner cases that the display items need to be invalidated
for paint offset | 1401 // There are corner cases that the display items need to be invalidated
for paint offset |
| 1402 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based | 1402 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based |
| 1403 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. | 1403 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. |
| 1404 // This is a workaround to force display items to update paint offset. | 1404 // This is a workaround to force display items to update paint offset. |
| 1405 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && paint
InvalidationState.forcedSubtreeInvalidationCheckingWithinContainer()) | 1405 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && paint
InvalidationState.forcedSubtreeInvalidationCheckingWithinContainer()) |
| 1406 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida
tionState, PaintInvalidationLocationChange); | 1406 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida
tionState, PaintInvalidationLocationChange); |
| 1407 | 1407 |
| 1408 return invalidationReason; | 1408 return invalidationReason; |
| 1409 } | 1409 } |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3422 } | 3422 } |
| 3423 | 3423 |
| 3424 void LayoutObject::setMayNeedPaintInvalidationSubtree() | 3424 void LayoutObject::setMayNeedPaintInvalidationSubtree() |
| 3425 { | 3425 { |
| 3426 if (mayNeedPaintInvalidationSubtree()) | 3426 if (mayNeedPaintInvalidationSubtree()) |
| 3427 return; | 3427 return; |
| 3428 m_bitfields.setMayNeedPaintInvalidationSubtree(true); | 3428 m_bitfields.setMayNeedPaintInvalidationSubtree(true); |
| 3429 setMayNeedPaintInvalidation(); | 3429 setMayNeedPaintInvalidation(); |
| 3430 } | 3430 } |
| 3431 | 3431 |
| 3432 void LayoutObject::setMayNeedPaintInvalidationAnimatgedBackgroundImage() |
| 3433 { |
| 3434 if (mayNeedPaintInvalidationAnimatedBackgroundImage()) |
| 3435 return; |
| 3436 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(true); |
| 3437 setMayNeedPaintInvalidation(); |
| 3438 } |
| 3439 |
| 3432 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) | 3440 void LayoutObject::clearPaintInvalidationFlags(const PaintInvalidationState& pai
ntInvalidationState) |
| 3433 { | 3441 { |
| 3434 // paintInvalidationStateIsDirty should be kept in sync with the | 3442 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3435 // booleans that are cleared below. | 3443 // booleans that are cleared below. |
| 3436 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); | 3444 ASSERT(!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()
|| paintInvalidationStateIsDirty()); |
| 3437 clearShouldDoFullPaintInvalidation(); | 3445 clearShouldDoFullPaintInvalidation(); |
| 3438 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3446 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3439 m_bitfields.setMayNeedPaintInvalidation(false); | 3447 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3440 m_bitfields.setMayNeedPaintInvalidationSubtree(false); | 3448 m_bitfields.setMayNeedPaintInvalidationSubtree(false); |
| 3449 m_bitfields.setMayNeedPaintInvalidationAnimatedBackgroundImage(false); |
| 3441 m_bitfields.setShouldInvalidateSelection(false); | 3450 m_bitfields.setShouldInvalidateSelection(false); |
| 3442 } | 3451 } |
| 3443 | 3452 |
| 3444 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) | 3453 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) |
| 3445 { | 3454 { |
| 3446 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() | 3455 return DeprecatedDisableModifyLayoutTreeStructureAsserts::canModifyLayoutTre
eStateInAnyState() |
| 3447 || document.lifecycle().stateAllowsLayoutTreeMutations(); | 3456 || document.lifecycle().stateAllowsLayoutTreeMutations(); |
| 3448 } | 3457 } |
| 3449 | 3458 |
| 3450 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() | 3459 DeprecatedDisableModifyLayoutTreeStructureAsserts::DeprecatedDisableModifyLayout
TreeStructureAsserts() |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 const blink::LayoutObject* root = object1; | 3664 const blink::LayoutObject* root = object1; |
| 3656 while (root->parent()) | 3665 while (root->parent()) |
| 3657 root = root->parent(); | 3666 root = root->parent(); |
| 3658 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3667 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3659 } else { | 3668 } else { |
| 3660 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3669 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3661 } | 3670 } |
| 3662 } | 3671 } |
| 3663 | 3672 |
| 3664 #endif | 3673 #endif |
| OLD | NEW |