 Chromium Code Reviews
 Chromium Code Reviews Issue 1026823002:
  [S.P.] Don't draw frames of animated images that are offscreen  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 1026823002:
  [S.P.] Don't draw frames of animated images that are offscreen  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| Index: Source/core/layout/LayoutObject.cpp | 
| diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp | 
| index f5e859a4720a8f87dce35e4a1bd908f6355e92dc..1131ec6e0bd583c747c5c3135bf4b80f6ae3021e 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(reason); | 
| + } | 
| + | 
| invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); | 
| } | 
| @@ -3109,7 +3115,7 @@ 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) | 
| @@ -3117,9 +3123,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); | 
| 
esprehn
2015/03/25 05:06:36
This still can let in bugs with the bits, if you u
 
chrishtr
2015/03/25 23:30:35
Done.
 | 
| } | 
| void LayoutObject::setMayNeedPaintInvalidation() |