| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| index f36b66cb19de939b00e1e070f36a93ac26ba091b..8078959bc4702a2b667680fcda1b765f864911c7 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
|
| @@ -1685,10 +1685,12 @@ void LayoutBox::imageChanged(WrappedImagePtr image, const IntRect*) {
|
| layer->image()->cachedImage() &&
|
| layer->image()->cachedImage()->getImage() &&
|
| layer->image()->cachedImage()->getImage()->maybeAnimated();
|
| - if (maybeAnimated)
|
| + if (maybeAnimated) {
|
| setMayNeedPaintInvalidationAnimatedBackgroundImage();
|
| - else
|
| + } else {
|
| setShouldDoFullPaintInvalidation();
|
| + setBackgroundChangedSinceLastPaintInvalidation();
|
| + }
|
| break;
|
| }
|
| }
|
| @@ -1755,6 +1757,27 @@ bool LayoutBox::intersectsVisibleViewport() const {
|
| layoutView->frameView()->getScrollableArea()->visibleContentRect()));
|
| }
|
|
|
| +void LayoutBox::ensureIsReadyForPaintInvalidation() {
|
| + LayoutBoxModelObject::ensureIsReadyForPaintInvalidation();
|
| +
|
| + if (mayNeedPaintInvalidationAnimatedBackgroundImage() &&
|
| + !backgroundIsKnownToBeObscured())
|
| + setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
|
| +
|
| + if (fullPaintInvalidationReason() != PaintInvalidationDelayedFull ||
|
| + !intersectsVisibleViewport())
|
| + return;
|
| +
|
| + // Do regular full paint invalidation if the object with
|
| + // PaintInvalidationDelayedFull is onscreen.
|
| + if (intersectsVisibleViewport()) {
|
| + // Conservatively assume the delayed paint invalidation was caused by
|
| + // background image change.
|
| + setBackgroundChangedSinceLastPaintInvalidation();
|
| + setShouldDoFullPaintInvalidation(PaintInvalidationFull);
|
| + }
|
| +}
|
| +
|
| PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(
|
| const PaintInvalidationState& paintInvalidationState) {
|
| if (hasBoxDecorationBackground()
|
|
|