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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1364063007: Throttle rendering pipeline for invisible frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IntersectionObserverification Created 5 years, 2 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: 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 9d509b260a4b41a38be8d87aa42518643296b90e..d6c5e367aad5b9c21aeea64cac140e0bf97a1ddb 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->shouldThrottleStyleLayoutAndCompositingUpdates())
+ 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->shouldThrottleStyleLayoutAndCompositingUpdates())
+ 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()->shouldThrottleRenderingPipeline()));
if (!m_rootContentLayer)
return String();
@@ -872,12 +880,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->shouldThrottleRenderingPipeline()));
} else {
- ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
+ ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean
+ || (view && view->shouldThrottleRenderingPipeline()));
}
#endif

Powered by Google App Engine
This is Rietveld 408576698