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

Side by Side Diff: cc/tree_synchronizer.cc

Issue 11575018: cc: Add id->LayerImpl map to LayerTreeImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« cc/layer_tree_impl.h ('K') | « cc/render_surface_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/tree_synchronizer.h" 5 #include "cc/tree_synchronizer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/layer.h" 8 #include "cc/layer.h"
9 #include "cc/layer_impl.h" 9 #include "cc/layer_impl.h"
10 #include "cc/scrollbar_animation_controller.h" 10 #include "cc/scrollbar_animation_controller.h"
(...skipping 19 matching lines...) Expand all
30 30
31 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap& oldLayers, scoped_ptr<LayerImpl> layerImpl) 31 void TreeSynchronizer::collectExistingLayerImplRecursive(ScopedPtrLayerImplMap& oldLayers, scoped_ptr<LayerImpl> layerImpl)
32 { 32 {
33 if (!layerImpl) 33 if (!layerImpl)
34 return; 34 return;
35 35
36 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children; 36 ScopedPtrVector<LayerImpl>& children = layerImpl->m_children;
37 for (size_t i = 0; i < children.size(); ++i) 37 for (size_t i = 0; i < children.size(); ++i)
38 collectExistingLayerImplRecursive(oldLayers, children.take(i)); 38 collectExistingLayerImplRecursive(oldLayers, children.take(i));
39 39
40 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_maskLayer.Pass()); 40 collectExistingLayerImplRecursive(oldLayers, layerImpl->takeMaskLayer());
41 collectExistingLayerImplRecursive(oldLayers, layerImpl->m_replicaLayer.Pass( )); 41 collectExistingLayerImplRecursive(oldLayers, layerImpl->takeReplicaLayer());
42 42
43 int id = layerImpl->id(); 43 int id = layerImpl->id();
44 oldLayers.set(id, layerImpl.Pass()); 44 oldLayers.set(id, layerImpl.Pass());
45 } 45 }
46 46
47 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeImpl* tre eImpl) 47 scoped_ptr<LayerImpl> TreeSynchronizer::reuseOrCreateLayerImpl(RawPtrLayerImplMa p& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeImpl* tre eImpl)
48 { 48 {
49 scoped_ptr<LayerImpl> layerImpl = oldLayers.take(layer->id()); 49 scoped_ptr<LayerImpl> layerImpl = oldLayers.take(layer->id());
50 50
51 if (!layerImpl) 51 if (!layerImpl)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 DCHECK(scrollbarLayerImpl); 102 DCHECK(scrollbarLayerImpl);
103 DCHECK(scrollLayerImpl); 103 DCHECK(scrollLayerImpl);
104 104
105 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) 105 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal)
106 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); 106 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl);
107 else 107 else
108 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); 108 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl);
109 } 109 }
110 110
111 } // namespace cc 111 } // namespace cc
OLDNEW
« cc/layer_tree_impl.h ('K') | « cc/render_surface_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698