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

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

Issue 183763016: Reduce compositing update in Silk's toggle_drawer by 20% (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix win build 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') | no next file » | 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 9b6c45f52815da9a92a57be42cbb0b8ae5dd00b9..b38da2abfa5537458e302130880a1def5c7c8376 100644
--- a/Source/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -204,6 +204,7 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
, m_showRepaintCounter(false)
, m_needsToRecomputeCompositingRequirements(false)
, m_needsToUpdateLayerTreeGeometry(false)
+ , m_pendingUpdateType(GraphicsLayerUpdater::DoNotForceUpdate)
, m_compositing(false)
, m_compositingLayersNeedRebuild(false)
, m_forceCompositingMode(false)
@@ -362,15 +363,23 @@ void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda
switch (updateType) {
case CompositingUpdateAfterStyleChange:
+ m_needsToRecomputeCompositingRequirements = true;
+ break;
case CompositingUpdateAfterLayout:
m_needsToRecomputeCompositingRequirements = true;
+ // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
+ m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
break;
case CompositingUpdateOnScroll:
m_needsToRecomputeCompositingRequirements = true; // Overlap can change with scrolling, so need to check for hierarchy updates.
m_needsToUpdateLayerTreeGeometry = true;
+ // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
+ m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
break;
case CompositingUpdateOnCompositedScroll:
m_needsToUpdateLayerTreeGeometry = true;
+ // FIXME: Ideally we'd be smarter about tracking dirtiness and wouldn't need a ForceUpdate here.
+ m_pendingUpdateType = GraphicsLayerUpdater::ForceUpdate;
break;
}
@@ -419,10 +428,14 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
if (!needCompositingRequirementsUpdate && !needHierarchyAndGeometryUpdate && !needGeometryUpdate && !needsToUpdateScrollingCoordinator)
return;
+ GraphicsLayerUpdater::UpdateType updateType = m_pendingUpdateType;
+
// Only clear the flags if we're updating the entire hierarchy.
m_compositingLayersNeedRebuild = false;
m_needsToUpdateLayerTreeGeometry = false;
m_needsToRecomputeCompositingRequirements = false;
+ m_pendingUpdateType = GraphicsLayerUpdater::DoNotForceUpdate;
+
RenderLayer* updateRoot = rootRenderLayer();
if (needCompositingRequirementsUpdate) {
@@ -471,7 +484,7 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
Vector<GraphicsLayer*> childList;
{
TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::rebuildTree");
- GraphicsLayerUpdater(*m_renderView).rebuildTree(*updateRoot, childList, 0);
+ GraphicsLayerUpdater(*m_renderView).rebuildTree(*updateRoot, updateType, childList, 0);
}
// Host the document layer in the RenderView's root layer.
@@ -491,7 +504,7 @@ void RenderLayerCompositor::updateCompositingLayersInternal()
// We just need to do a geometry update. This is only used for position:fixed scrolling;
// most of the time, geometry is updated via RenderLayer::styleChanged().
TRACE_EVENT0("blink_rendering", "GraphicsLayerUpdater::updateRecursive");
- GraphicsLayerUpdater(*m_renderView).updateRecursive(*updateRoot);
+ GraphicsLayerUpdater(*m_renderView).updateRecursive(*updateRoot, updateType);
}
ASSERT(updateRoot || !m_compositingLayersNeedRebuild);
@@ -1402,7 +1415,7 @@ void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayerStack
reflectionLayer->compositedLayerMapping()->updateCompositedBounds();
}
- compositedLayerMapping->updateGraphicsLayerGeometry();
+ compositedLayerMapping->updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate);
if (compositedChildrenOnly)
return;
}
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698