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

Unified Diff: Source/core/layout/LayoutObject.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/layout/LayoutImage.cpp ('k') | Source/platform/graphics/PaintInvalidationReason.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index d4348ce568893542bdb893da760d63d528ab85b1..1a06ec6756a7ff22568b75c1e7b849da58243c45 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -1200,8 +1200,14 @@ void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
if (!shouldCheckForPaintInvalidation(paintInvalidationState))
return;
- invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationState.paintInvalidationContainer());
- clearPaintInvalidationState(paintInvalidationState);
+ PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationState.paintInvalidationContainer());
+ if (reason != PaintInvalidationDelayedFull) {
+ clearPaintInvalidationState(paintInvalidationState);
+ } else {
+ // Mark this object as needing paint invalidation again in the next frame, due to the request for delayed paint invalidation.
+ setShouldDoFullPaintInvalidation(reason);
+ }
+
invalidatePaintOfSubtreesIfNeeded(paintInvalidationState);
}
@@ -3105,8 +3111,10 @@ static PaintInvalidationReason documentLifecycleBasedPaintInvalidationReason(con
void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reason)
{
+
+
// Only full invalidation reasons are allowed.
- ASSERT(isFullPaintInvalidationReason(reason));
+ ASSERT(isFullPaintInvalidationReason(reason) || reason == PaintInvalidationDelayedFull);
if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) {
if (reason == PaintInvalidationFull)
@@ -3114,9 +3122,9 @@ void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas
m_bitfields.setFullPaintInvalidationReason(reason);
}
- ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation);
frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
markContainerChainForPaintInvalidation();
+ ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation || reason == PaintInvalidationDelayedFull);
chrishtr 2015/03/20 16:58:54 I also restored the asserts in this method to avoi
}
void LayoutObject::setMayNeedPaintInvalidation()
« no previous file with comments | « Source/core/layout/LayoutImage.cpp ('k') | Source/platform/graphics/PaintInvalidationReason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698