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

Unified Diff: Source/core/layout/LayoutObject.cpp

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/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index f5e859a4720a8f87dce35e4a1bd908f6355e92dc..40bd6bda06659c3cdc866565a5d609e9fba58c21 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -1203,8 +1203,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();
+ }
+
invalidatePaintOfSubtreesIfNeeded(paintInvalidationState);
}
@@ -3117,7 +3123,6 @@ void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas
m_bitfields.setFullPaintInvalidationReason(reason);
}
- ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation);
esprehn 2015/03/20 06:52:32 Are you sure this is safe? Calling markContainerCh
chrishtr 2015/03/20 16:44:45 Good point, this assert is still valuable for prev
frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called outside of FrameView::updateLayoutAndStyleForPainting().
markContainerChainForPaintInvalidation();
}

Powered by Google App Engine
This is Rietveld 408576698