Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| index ae056237c7ad1826e4d54cf539835e48eef5ae6a..ac7d12e08279b18e7b9d07ad3dd91d54862f68b7 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| @@ -194,6 +194,10 @@ void updateDescendantDependentFlagsForEntireSubtree(PaintLayer& layer) |
| void PaintLayerCompositor::updateIfNeededRecursive() |
| { |
| + FrameView* view = m_layoutView.frameView(); |
| + if (view->shouldThrottleRenderingIfAllowed()) |
| + return; |
| + |
| for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); child; child = child->tree().nextSibling()) { |
| if (!child->isLocalFrame()) |
| continue; |
| @@ -238,8 +242,12 @@ void PaintLayerCompositor::updateIfNeededRecursive() |
| ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean); |
| assertNoUnresolvedDirtyBits(); |
| for (Frame* child = m_layoutView.frameView()->frame().tree().firstChild(); child; child = child->tree().nextSibling()) { |
| - if (child->isLocalFrame()) |
| - toLocalFrame(child)->contentLayoutObject()->compositor()->assertNoUnresolvedDirtyBits(); |
| + if (!child->isLocalFrame()) |
| + continue; |
| + LocalFrame* localFrame = toLocalFrame(child); |
| + if (localFrame->shouldThrottleRenderingIfAllowed()) |
| + continue; |
| + localFrame->contentLayoutObject()->compositor()->assertNoUnresolvedDirtyBits(); |
| } |
| #endif |
| } |
| @@ -608,7 +616,7 @@ bool PaintLayerCompositor::scrollingLayerDidChange(PaintLayer* layer) |
| String PaintLayerCompositor::layerTreeAsText(LayerTreeFlags flags) |
| { |
| - ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean); |
| + ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || (m_layoutView.frameView() && m_layoutView.frameView()->shouldThrottleRendering())); |
|
esprehn
2015/10/14 22:09:46
If there's a compositor there must be a FrameView,
Sami
2015/10/16 16:48:09
Done.
|
| if (!m_rootContentLayer) |
| return String(); |
| @@ -877,12 +885,15 @@ void PaintLayerCompositor::resetTrackedPaintInvalidationRects() |
| void PaintLayerCompositor::setTracksPaintInvalidations(bool tracksPaintInvalidations) |
| { |
| #if ENABLE(ASSERT) |
| + FrameView* view = m_layoutView.frameView(); |
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| ASSERT(lifecycle().state() == DocumentLifecycle::CompositingForSlimmingPaintV2Clean |
| // TODO(wangxianzhu): Remove this when we remove the old path for spv2. |
| - || lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); |
| + || lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| + || (view && view->shouldThrottleRendering())); |
|
esprehn
2015/10/14 22:09:46
ditto, no need for null check
Sami
2015/10/16 16:48:09
Done.
|
| } else { |
| - ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean); |
| + ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean |
| + || (view && view->shouldThrottleRendering())); |
| } |
| #endif |