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.needsPaintInvalidationSubtree()) { | 169 if (parent() && diff.needsPaintInvalidationLayer()) { |
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 |
401 if (previousPosition != previousPositionFromPaintInvalidationBacking()) | 404 if (previousPosition != previousPositionFromPaintInvalidationBacking()) |
402 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); | 405 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
403 | 406 |
404 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre
eIfNeeded() when removing the following workarounds. | 407 // TODO(wangxianzhu): Combine this function into LayoutObject::invalidateTre
eIfNeeded() when removing the following workarounds. |
405 | 408 |
406 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. | 409 // TODO(wangxianzhu): This is a workaround for crbug.com/533277. Will remove
when we enable paint offset caching. |
407 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) | 410 if (reason != PaintInvalidationNone && hasPercentageTransform(styleRef())) |
408 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); | 411 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
409 | 412 |
410 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check | 413 // TODO(wangxianzhu): This is a workaround for crbug.com/490725. We don't ha
ve enough saved information to do accurate check |
411 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. | 414 // of clipping change. Will remove when we remove rect-based paint invalidat
ion. |
412 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 415 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
413 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) | 416 && previousPaintInvalidationRect != this->previousPaintInvalidationRect(
) |
414 && !usesCompositedScrolling() | 417 && !usesCompositedScrolling() |
415 && hasOverflowClip()) | 418 && hasOverflowClip()) |
416 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); | 419 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon
tainer(); |
417 | 420 |
418 newPaintInvalidationState.updateForChildren(reason); | 421 newPaintInvalidationState.updateForChildren(); |
419 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 422 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
420 } | 423 } |
421 | 424 |
422 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst | 425 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe
ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c
onst |
423 { | 426 { |
424 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. | 427 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. |
425 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 428 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
426 | 429 |
427 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, | 430 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible
crash here, |
428 // so assert but check that the layer is composited. | 431 // so assert but check that the layer is composited. |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 if (rootElementStyle->hasBackground()) | 1135 if (rootElementStyle->hasBackground()) |
1133 return false; | 1136 return false; |
1134 | 1137 |
1135 if (node() != document().firstBodyElement()) | 1138 if (node() != document().firstBodyElement()) |
1136 return false; | 1139 return false; |
1137 | 1140 |
1138 return true; | 1141 return true; |
1139 } | 1142 } |
1140 | 1143 |
1141 } // namespace blink | 1144 } // namespace blink |
OLD | NEW |