Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Unified Diff: Source/core/layout/LayoutImage.h

Issue 1008043002: [S.P.] Don't draw frames of animated images that are offscreen. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/LayoutImage.h
diff --git a/Source/core/layout/LayoutImage.h b/Source/core/layout/LayoutImage.h
index 88b145ba4868dc680a0c0aa1451d9afb4b929152..34567dd7ffcbddea8a49ffa9559d00c154c5096a 100644
--- a/Source/core/layout/LayoutImage.h
+++ b/Source/core/layout/LayoutImage.h
@@ -83,6 +83,8 @@ protected:
virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutImage || LayoutReplaced::isOfType(type); }
+ virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationState&, const LayoutBoxModelObject&) override;
+
private:
virtual bool isImage() const override { return true; }
@@ -105,6 +107,9 @@ private:
// Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect.
void updateInnerContentRect();
+ // The given rect is in the local coordinate space of the LayoutImage.
+ bool rectIntersectsVisibleViewport(const LayoutRect&);
+
// Text to display as long as the image isn't available.
OwnPtr<LayoutImageResource> m_imageResource;
bool m_didIncrementVisuallyNonEmptyPixelCount;

Powered by Google App Engine
This is Rietveld 408576698