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

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: Created 6 years, 10 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 40ac4ccd786e97b347b483b5e452952a34cc831b..a9e9e1caf2cbdcb7af24e4ea27a292b594c1f8bd 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.
@@ -781,7 +787,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.
@@ -860,6 +866,8 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry()
registerScrollingLayers();
updateCompositingReasons();
+
+ return updateType;
}
void CompositedLayerMapping::registerScrollingLayers()
@@ -1792,6 +1800,23 @@ void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
}
}
+void CompositedLayerMapping::setNeedsGeometryUpdate()
+{
+ m_needToUpdateGeometryOfAllDecendants = true;
+
+ for (RenderLayer* current = m_owningLayer; current; current = current->ancestorCompositingLayer()) {
+ ASSERT(current->hasCompositedLayerMapping());
+ CompositedLayerMappingPtr mapping = current->compositedLayerMapping();
+ mapping->m_needToUpdateGeometry = true;
+ }
+}
+
+void CompositedLayerMapping::willUpdateGeometryOfAllDecendants()
+{
+ ASSERT(!m_needToUpdateGeometry);
+ m_needToUpdateGeometryOfAllDecendants = false;
+}
+
struct SetContentsNeedsDisplayFunctor {
void operator() (GraphicsLayer* layer) const
{

Powered by Google App Engine
This is Rietveld 408576698