Chromium Code Reviews| 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() |