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

Unified Diff: Source/core/frame/FrameView.cpp

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/frame/FrameView.h ('k') | Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 2b708e618d9e068aff2c17330d3002c2ceeb2c91..214a15e140f36f7f21b453ed0d567b3566f4ad13 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1113,7 +1113,7 @@ void FrameView::layout()
// method would setNeedsRedraw on the GraphicsLayers with invalidations and
// let the compositor pick which to actually draw.
// See http://crbug.com/306706
-void FrameView::invalidateTreeIfNeeded()
+void FrameView::invalidateTreeIfNeeded(Vector<LayoutObject*>& pendingDelayedPaintInvalidations)
{
ASSERT(layoutView());
LayoutView& rootForPaintInvalidation = *layoutView();
@@ -1121,7 +1121,7 @@ void FrameView::invalidateTreeIfNeeded()
TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInvalidation.debugName().ascii());
- PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation);
+ PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation, pendingDelayedPaintInvalidations);
// In slimming paint mode we do per-object invalidation.
if (m_doFullPaintInvalidation && !RuntimeEnabledFeatures::slimmingPaintEnabled())
@@ -1136,7 +1136,6 @@ void FrameView::invalidateTreeIfNeeded()
invalidateRect(horizontalBarDamage());
resetScrollbarDamage();
-
#if ENABLE(ASSERT)
layoutView()->assertSubtreeClearedPaintInvalidationState();
#endif
@@ -2607,7 +2606,10 @@ void FrameView::invalidateTreeIfNeededRecursive()
{
// FIXME: We should be more aggressive at cutting tree traversals.
lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation);
- invalidateTreeIfNeeded();
+
+ Vector<LayoutObject*> pendingDelayedPaintInvalidations;
+
+ invalidateTreeIfNeeded(pendingDelayedPaintInvalidations);
for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
if (!child->isLocalFrame())
@@ -2618,6 +2620,10 @@ void FrameView::invalidateTreeIfNeededRecursive()
m_doFullPaintInvalidation = false;
lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
+
+ // Process objects needing paint invalidation on the next frame. See the definition of PaintInvalidationDelayedFull for more details.
+ for (auto& target : pendingDelayedPaintInvalidations)
+ target->setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
}
void FrameView::enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize)
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698