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

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

Issue 1026823002: [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
« no previous file with comments | « Source/core/layout/LayoutHTMLCanvas.cpp ('k') | Source/core/layout/LayoutImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutImage.h
diff --git a/Source/core/layout/LayoutImage.h b/Source/core/layout/LayoutImage.h
index 4f6be49c878c7778b5e064894cab6a1e799eb0d8..375869f7e0b124279b6ed28bb47249a185010153 100644
--- a/Source/core/layout/LayoutImage.h
+++ b/Source/core/layout/LayoutImage.h
@@ -84,6 +84,8 @@ protected:
virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutImage || LayoutReplaced::isOfType(type); }
+ virtual PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationState&, const LayoutBoxModelObject&) override;
+
private:
virtual bool isImage() const override { return true; }
@@ -106,6 +108,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();
+ // Returns true if the image intersects the viewport visible to the user.
+ bool intersectsVisibleViewport();
+
// Text to display as long as the image isn't available.
OwnPtr<LayoutImageResource> m_imageResource;
bool m_didIncrementVisuallyNonEmptyPixelCount;
« no previous file with comments | « Source/core/layout/LayoutHTMLCanvas.cpp ('k') | Source/core/layout/LayoutImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698