| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // The following disablers are valid because we need to invalidate based
on the current | 159 // The following disablers are valid because we need to invalidate based
on the current |
| 160 // status. | 160 // status. |
| 161 DisableCompositingQueryAsserts compositingDisabler; | 161 DisableCompositingQueryAsserts compositingDisabler; |
| 162 DisablePaintInvalidationStateAsserts paintDisabler; | 162 DisablePaintInvalidationStateAsserts paintDisabler; |
| 163 invalidatePaintIncludingNonCompositingDescendants(); | 163 invalidatePaintIncludingNonCompositingDescendants(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 FloatStateForStyleChange::setWasFloating(this, isFloating()); | 166 FloatStateForStyleChange::setWasFloating(this, isFloating()); |
| 167 | 167 |
| 168 if (const ComputedStyle* oldStyle = style()) { | 168 if (const ComputedStyle* oldStyle = style()) { |
| 169 if (parent() && diff.needsPaintInvalidationLayer()) { | 169 if (parent() && diff.needsPaintInvalidationSubtree()) { |
| 170 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() | 170 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() |
| 171 || oldStyle->clip() != newStyle.clip()) | 171 || oldStyle->clip() != newStyle.clip()) |
| 172 layer()->clipper().clearClipRectsIncludingDescendants(); | 172 layer()->clipper().clearClipRectsIncludingDescendants(); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 LayoutObject::styleWillChange(diff, newStyle); | 176 LayoutObject::styleWillChange(diff, newStyle); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt
yle* oldStyle) | 179 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt
yle* oldStyle) |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); | 392 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); |
| 393 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) | 393 if (!shouldCheckForPaintInvalidation(newPaintInvalidationState)) |
| 394 return; | 394 return; |
| 395 | 395 |
| 396 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe
ct(); | 396 LayoutRect previousPaintInvalidationRect = this->previousPaintInvalidationRe
ct(); |
| 397 LayoutPoint previousPosition = previousPositionFromPaintInvalidationBacking(
); | 397 LayoutPoint previousPosition = previousPositionFromPaintInvalidationBacking(
); |
| 398 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 398 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
| 399 clearPaintInvalidationFlags(newPaintInvalidationState); | 399 clearPaintInvalidationFlags(newPaintInvalidationState); |
| 400 | 400 |
| 401 if (reason == PaintInvalidationDelayedFull) | |
| 402 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | |
| 403 | |
| 404 if (previousPosition != previousPositionFromPaintInvalidationBacking()) | 401 if (previousPosition != previousPositionFromPaintInvalidationBacking()) |
| 405 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 402 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); |
| 406 | 403 |
| 407 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre
eIfNeeded() when removing the following workarounds. | 404 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre
eIfNeeded() when removing the following workarounds. |
| 408 | 405 |
| 409 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. | 406 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. |
| 410 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) | 407 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) |
| 411 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 408 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); |
| 412 | 409 |
| 413 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check | 410 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check |
| 414 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. | 411 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. |
| 415 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 412 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 416 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) | 413 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) |
| 417 && !usesCompositedScrolling() | 414 && !usesCompositedScrolling() |
| 418 && hasOverflowClip()) | 415 && hasOverflowClip()) |
| 419 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); | 416 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); |
| 420 | 417 |
| 421 newPaintInvalidationState.updateForChildren(); | 418 newPaintInvalidationState.updateForChildren(reason); |
| 422 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 419 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 423 } | 420 } |
| 424 | 421 |
| 425 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst | 422 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst |
| 426 { | 423 { |
| 427 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. | 424 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. |
| 428 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 425 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 429 | 426 |
| 430 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 427 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
| 431 // so assert but check that the layer is composited. | 428 // so assert but check that the layer is composited. |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 if (rootElementStyle->hasBackground()) | 1132 if (rootElementStyle->hasBackground()) |
| 1136 return false; | 1133 return false; |
| 1137 | 1134 |
| 1138 if (node() != document().firstBodyElement()) | 1135 if (node() != document().firstBodyElement()) |
| 1139 return false; | 1136 return false; |
| 1140 | 1137 |
| 1141 return true; | 1138 return true; |
| 1142 } | 1139 } |
| 1143 | 1140 |
| 1144 } // namespace blink | 1141 } // namespace blink |
| OLD | NEW |