| Index: Source/core/layout/LayoutImage.cpp
|
| diff --git a/Source/core/layout/LayoutImage.cpp b/Source/core/layout/LayoutImage.cpp
|
| index afb0a2f220ad5829433fdb36705cc15a4bad01eb..353f75b8bb630f1fcd46ad2fa42e0949fa4208a6 100644
|
| --- a/Source/core/layout/LayoutImage.cpp
|
| +++ b/Source/core/layout/LayoutImage.cpp
|
| @@ -40,6 +40,7 @@
|
| #include "core/html/HTMLMapElement.h"
|
| #include "core/layout/HitTestResult.h"
|
| #include "core/layout/Layer.h"
|
| +#include "core/layout/LayoutPart.h"
|
| #include "core/layout/LayoutView.h"
|
| #include "core/layout/PaintInfo.h"
|
| #include "core/layout/TextRunConstructor.h"
|
| @@ -176,6 +177,30 @@ void LayoutImage::invalidatePaintAndMarkForLayoutIfNeeded()
|
| contentChanged(ImageChanged);
|
| }
|
|
|
| +bool LayoutImage::rectIntersectsVisibleViewport(const LayoutRect& localRect)
|
| +{
|
| + LayoutRect rect = localRect;
|
| + LayoutView* layoutView = view();
|
| + while (layoutView->frame()->ownerLayoutObject())
|
| + layoutView = layoutView->frame()->ownerLayoutObject()->view();
|
| + mapRectToPaintInvalidationBacking(layoutView, rect, 0);
|
| + return rect.intersects(LayoutRect(layoutView->frameView()->visualViewportRect()));
|
| +}
|
| +
|
| +PaintInvalidationReason LayoutImage::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContainer)
|
| +{
|
| + if (!RuntimeEnabledFeatures::slimmingPaintEnabled())
|
| + return LayoutReplaced::invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationContainer);
|
| +
|
| + if (!imageResource() || !imageResource()->image() || !imageResource()->image()->maybeAnimated()
|
| + || rectIntersectsVisibleViewport(visualOverflowRect())) {
|
| + return LayoutReplaced::invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationContainer);
|
| + }
|
| +
|
| + return PaintInvalidationDelayedFull;
|
| +}
|
| +
|
| +
|
| void LayoutImage::notifyFinished(Resource* newImage)
|
| {
|
| if (!m_imageResource)
|
|
|