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

Unified Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 202533003: Don't schedule an animation during compositing dirty-bit setting unless needed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add null check. Created 6 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | Source/web/PageWidgetDelegate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/compositing/RenderLayerCompositor.cpp b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
index 32563e506ffc7042cd66ec0c7de38d3caf1fb4bb..e468f7e5d5aba2673d3a1a81fcb0f3f63e6fdf2e 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -285,8 +285,7 @@ void RenderLayerCompositor::setCompositingLayersNeedRebuild()
// FIXME: crbug,com/332248 ideally this could be merged with setNeedsCompositingUpdate().
if (inCompositingMode())
m_compositingLayersNeedRebuild = true;
-
- m_renderView.frameView()->scheduleAnimation();
+ page()->animator().scheduleVisualUpdate();
}
void RenderLayerCompositor::updateCompositingRequirementsState()
@@ -385,7 +384,7 @@ void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda
break;
}
- m_renderView.frameView()->scheduleAnimation();
+ page()->animator().scheduleVisualUpdate();
}
void RenderLayerCompositor::updateCompositingLayers()
@@ -411,6 +410,25 @@ void RenderLayerCompositor::updateCompositingLayers()
ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::CompositingClean);
}
+void RenderLayerCompositor::scheduleAnimationIfNeeded()
+{
+ LocalFrame* localFrame = &m_renderView.frameView()->frame();
+ for (LocalFrame* currentFrame = localFrame; currentFrame; currentFrame = currentFrame->tree().traverseNext(localFrame)) {
+ if (currentFrame->contentRenderer()) {
+ RenderLayerCompositor* childCompositor = currentFrame->contentRenderer()->compositor();
+ if (childCompositor && childCompositor->hasUnresolvedDirtyBits()) {
+ m_renderView.frameView()->scheduleAnimation();
+ return;
+ }
+ }
+ }
+}
+
+bool RenderLayerCompositor::hasUnresolvedDirtyBits()
+{
+ return m_needsToRecomputeCompositingRequirements || m_compositingLayersNeedRebuild || m_needsToUpdateLayerTreeGeometry || m_needsUpdateCompositingRequirementsState || m_pendingUpdateType != GraphicsLayerUpdater::DoNotForceUpdate;
+}
+
void RenderLayerCompositor::updateCompositingLayersInternal()
{
if (isMainFrame() && m_renderView.frameView())
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | Source/web/PageWidgetDelegate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698