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

Unified Diff: cc/tree_synchronizer.cc

Issue 10690168: Aura: Resize locks with --ui-enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved needing to kick a frame logic up to RWHVA from Compositor. Created 8 years, 2 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: cc/tree_synchronizer.cc
diff --git a/cc/tree_synchronizer.cc b/cc/tree_synchronizer.cc
index b7e76bbe9ab16d6843bfb26937329c17e35b6233..d7f63cb98b8adf9d83a2ec6eb44afb10cc51f530 100644
--- a/cc/tree_synchronizer.cc
+++ b/cc/tree_synchronizer.cc
@@ -19,7 +19,7 @@ scoped_ptr<CCLayerImpl> TreeSynchronizer::synchronizeTrees(LayerChromium* layerC
ScopedPtrCCLayerImplMap oldLayers;
RawPtrCCLayerImplMap newLayers;
- collectExistingCCLayerImplRecursive(oldLayers, oldCCLayerImplRoot.Pass());
+ collectExistingCCLayerImplRecursive(layerChromiumRoot, oldLayers, oldCCLayerImplRoot.Pass());
scoped_ptr<CCLayerImpl> newTree = synchronizeTreeRecursive(newLayers, oldLayers, layerChromiumRoot, hostImpl);
@@ -28,17 +28,26 @@ scoped_ptr<CCLayerImpl> TreeSynchronizer::synchronizeTrees(LayerChromium* layerC
return newTree.Pass();
}
-void TreeSynchronizer::collectExistingCCLayerImplRecursive(ScopedPtrCCLayerImplMap& oldLayers, scoped_ptr<CCLayerImpl> ccLayerImpl)
+void TreeSynchronizer::collectExistingCCLayerImplRecursive(LayerChromium* layer, ScopedPtrCCLayerImplMap& oldLayers, scoped_ptr<CCLayerImpl> ccLayerImpl)
{
- if (!ccLayerImpl)
+ if (!layer || !ccLayerImpl || layer->id() != ccLayerImpl->id())
return;
- ScopedPtrVector<CCLayerImpl>& children = ccLayerImpl->m_children;
- for (size_t i = 0; i < children.size(); ++i)
- collectExistingCCLayerImplRecursive(oldLayers, children.take(i));
+ if (!layer->deferUpdates()) {
+ ScopedPtrVector<CCLayerImpl>& oldChildren = ccLayerImpl->m_children;
+ ScopedPtrCCLayerImplMap oldChildrenMap;
+ for (size_t i = 0; i < oldChildren.size(); ++i) {
+ int oldChildId = oldChildren[i]->id();
+ oldChildrenMap.set(oldChildId, oldChildren.take(i));
+ }
- collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_maskLayer.Pass());
- collectExistingCCLayerImplRecursive(oldLayers, ccLayerImpl->m_replicaLayer.Pass());
+ const LayerChromium::LayerList& children = layer->children();
+ for (size_t i = 0; i < children.size(); ++i)
+ collectExistingCCLayerImplRecursive(children[i].get(), oldLayers, oldChildrenMap.take(children[i]->id()));
piman 2012/10/17 21:26:32 Why is it a problem to collect all the older layer
jonathan.backer 2012/10/18 20:20:35 Collecting all the old layers detroys the LayerImp
+
+ collectExistingCCLayerImplRecursive(layer->maskLayer(), oldLayers, ccLayerImpl->m_maskLayer.Pass());
+ collectExistingCCLayerImplRecursive(layer->replicaLayer(), oldLayers, ccLayerImpl->m_replicaLayer.Pass());
+ }
int id = ccLayerImpl->id();
oldLayers.set(id, ccLayerImpl.Pass());
@@ -60,6 +69,9 @@ scoped_ptr<CCLayerImpl> TreeSynchronizer::synchronizeTreeRecursive(RawPtrCCLayer
if (!layer)
return scoped_ptr<CCLayerImpl>();
+ if (layer->deferUpdates())
+ return oldLayers.take(layer->id());
+
scoped_ptr<CCLayerImpl> ccLayerImpl = reuseOrCreateCCLayerImpl(newLayers, oldLayers, layer);
ccLayerImpl->clearChildList();

Powered by Google App Engine
This is Rietveld 408576698