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

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: Cleanup. 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 1ec3750969ebc2b8613ca5c6ebce60d59bc70495..9b97aca050812d254b634c7c898c3c6288c7caba 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,26 @@ void RenderLayerCompositor::updateCompositingLayers()
ASSERT(m_renderView.document().lifecycle().state() == DocumentLifecycle::CompositingClean);
}
+void RenderLayerCompositor::scheduleAnimationIfNeeded()
+{
+ if (hasUnresolvedDirtyBits())
+ m_renderView.frameView()->scheduleAnimation();
abarth-chromium 2014/03/19 18:04:57 Should we early return here?
chrishtr 2014/03/19 18:16:00 Done. Confirmed with enne@ that this is ok.
+
+ LocalFrame* localFrame = &m_renderView.frameView()->frame();
+ for (LocalFrame* child = localFrame->tree().firstChild(); child; child = child->tree().nextSibling()) {
+ if (child->contentRenderer()) {
+ RenderLayerCompositor* childCompositor = child->contentRenderer()->compositor();
+ if (childCompositor)
+ childCompositor->scheduleAnimationIfNeeded();
abarth-chromium 2014/03/19 18:04:57 Rather than using recursion here, we can use frame
chrishtr 2014/03/19 18:16:00 Done.
+ }
+ }
+}
+
+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