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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.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
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 3ce4290754caaf99725c2b7979cdb3f2ffe5c226..c4b925762ab4a9360faa4d603027796c39291d98 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -421,7 +421,7 @@ void CompositedLayerMapping::updateAfterLayout(UpdateAfterLayoutFlags flags)
layerCompositor->updateCompositingDescendantGeometry(m_owningLayer->stackingNode(), m_owningLayer, flags & CompositingChildrenOnly);
if (flags & IsUpdateRoot) {
- updateGraphicsLayerGeometry();
+ updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate);
layerCompositor->updateRootLayerPosition();
RenderLayerStackingNode* stackingContainer = m_owningLayer->stackingNode()->enclosingStackingContainerNode();
if (!layerCompositor->compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != m_owningLayer->stackingNode()))
@@ -617,11 +617,17 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const IntPoint& delta)
}
}
-void CompositedLayerMapping::updateGraphicsLayerGeometry()
+GraphicsLayerUpdater::UpdateType CompositedLayerMapping::updateGraphicsLayerGeometry(GraphicsLayerUpdater::UpdateType updateType)
{
// If we haven't built z-order lists yet, wait until later.
if (m_owningLayer->stackingNode()->isStackingContainer() && m_owningLayer->stackingNode()->zOrderListsDirty())
- return;
+ return updateType;
+
+ if (!m_needToUpdateGeometry && updateType != GraphicsLayerUpdater::ForceUpdate)
+ return updateType;
+ m_needToUpdateGeometry = false;
+ if (m_needToUpdateGeometryOfAllDecendants)
+ updateType = GraphicsLayerUpdater::ForceUpdate;
// Set transform property, if it is not animating. We have to do this here because the transform
// is affected by the layer dimensions.
@@ -783,7 +789,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
if (m_owningLayer->reflectionInfo() && m_owningLayer->reflectionInfo()->reflectionLayer()->hasCompositedLayerMapping()) {
CompositedLayerMappingPtr reflectionCompositedLayerMapping = m_owningLayer->reflectionInfo()->reflectionLayer()->compositedLayerMapping();
- reflectionCompositedLayerMapping->updateGraphicsLayerGeometry();
+ reflectionCompositedLayerMapping->updateGraphicsLayerGeometry(GraphicsLayerUpdater::ForceUpdate);
// The reflection layer has the bounds of m_owningLayer->reflectionLayer(),
// but the reflected layer is the bounds of this layer, so we need to position it appropriately.
@@ -862,6 +868,8 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
registerScrollingLayers();
updateCompositingReasons();
+
+ return updateType;
}
void CompositedLayerMapping::registerScrollingLayers()
@@ -1849,6 +1857,28 @@ void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
}
}
+void CompositedLayerMapping::setNeedsGeometryUpdate()
+{
+ m_needToUpdateGeometryOfAllDecendants = true;
+
+ for (RenderLayer* current = m_owningLayer; current; current = current->ancestorCompositingLayer()) {
+ // FIXME: We should be able to return early from this function once we
+ // find a CompositedLayerMapping that has m_needToUpdateGeometry set.
+ // However, we can't do that until we remove the incremental compositing
+ // updates because they can clear m_needToUpdateGeometry without walking
+ // the whole tree.
+ ASSERT(current->hasCompositedLayerMapping());
+ CompositedLayerMappingPtr mapping = current->compositedLayerMapping();
+ mapping->m_needToUpdateGeometry = true;
+ }
+}
+
+void CompositedLayerMapping::clearNeedsGeometryUpdate()
+{
+ m_needToUpdateGeometry = false;
+ m_needToUpdateGeometryOfAllDecendants = false;
+}
+
struct SetContentsNeedsDisplayFunctor {
void operator() (GraphicsLayer* layer) const
{
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | Source/core/rendering/compositing/GraphicsLayerUpdater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698