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

Side by Side Diff: cc/tree_synchronizer.cc

Issue 11447028: cc: Split out calcDrawEtc from drawLayers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up unnecessary test changes 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return layerImpl.Pass(); 55 return layerImpl.Pass();
56 } 56 }
57 57
58 scoped_ptr<LayerImpl> TreeSynchronizer::synchronizeTreeRecursive(RawPtrLayerImpl Map& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeHostImp l* hostImpl) 58 scoped_ptr<LayerImpl> TreeSynchronizer::synchronizeTreeRecursive(RawPtrLayerImpl Map& newLayers, ScopedPtrLayerImplMap& oldLayers, Layer* layer, LayerTreeHostImp l* hostImpl)
59 { 59 {
60 if (!layer) 60 if (!layer)
61 return scoped_ptr<LayerImpl>(); 61 return scoped_ptr<LayerImpl>();
62 62
63 scoped_ptr<LayerImpl> layerImpl = reuseOrCreateLayerImpl(newLayers, oldLayer s, layer); 63 scoped_ptr<LayerImpl> layerImpl = reuseOrCreateLayerImpl(newLayers, oldLayer s, layer);
64 64
65 // This call is not strictly necessary, but it prevents an extra tree
66 // recursion to set the host after synchronization in setRootLayer.
67 layerImpl->setLayerTreeHostImpl(hostImpl);
danakj 2012/12/06 19:12:10 Now the cc::Layer will be able to reach through an
enne (OOO) 2012/12/06 19:25:42 Is there something wrong with that?
danakj 2012/12/06 19:32:20 I'm not sure :) I know it's informed design choice
enne (OOO) 2012/12/06 19:34:09 It has?? I don't have any sense of what you're ref
danakj 2012/12/06 19:36:20 I'm trying to remember what it was, but at least o
enne (OOO) 2012/12/06 19:49:02 "I had to do something another way because I didn'
danakj 2012/12/06 19:51:56 I'm not really sure, I just wanted to make sure yo
68
65 layerImpl->clearChildList(); 69 layerImpl->clearChildList();
66 const std::vector<scoped_refptr<Layer> >& children = layer->children(); 70 const std::vector<scoped_refptr<Layer> >& children = layer->children();
67 for (size_t i = 0; i < children.size(); ++i) 71 for (size_t i = 0; i < children.size(); ++i)
68 layerImpl->addChild(synchronizeTreeRecursive(newLayers, oldLayers, child ren[i].get(), hostImpl)); 72 layerImpl->addChild(synchronizeTreeRecursive(newLayers, oldLayers, child ren[i].get(), hostImpl));
69 73
70 layerImpl->setMaskLayer(synchronizeTreeRecursive(newLayers, oldLayers, layer ->maskLayer(), hostImpl)); 74 layerImpl->setMaskLayer(synchronizeTreeRecursive(newLayers, oldLayers, layer ->maskLayer(), hostImpl));
71 layerImpl->setReplicaLayer(synchronizeTreeRecursive(newLayers, oldLayers, la yer->replicaLayer(), hostImpl)); 75 layerImpl->setReplicaLayer(synchronizeTreeRecursive(newLayers, oldLayers, la yer->replicaLayer(), hostImpl));
72 76
73 layer->pushPropertiesTo(layerImpl.get()); 77 layer->pushPropertiesTo(layerImpl.get());
74 layerImpl->setLayerTreeHostImpl(hostImpl);
75 78
76 // Remove all dangling pointers. The pointers will be setup later in updateS crollbarLayerPointersRecursive phase 79 // Remove all dangling pointers. The pointers will be setup later in updateS crollbarLayerPointersRecursive phase
77 if (ScrollbarAnimationController* scrollbarController = layerImpl->scrollbar AnimationController()) { 80 if (ScrollbarAnimationController* scrollbarController = layerImpl->scrollbar AnimationController()) {
78 scrollbarController->setHorizontalScrollbarLayer(0); 81 scrollbarController->setHorizontalScrollbarLayer(0);
79 scrollbarController->setVerticalScrollbarLayer(0); 82 scrollbarController->setVerticalScrollbarLayer(0);
80 } 83 }
81 84
82 return layerImpl.Pass(); 85 return layerImpl.Pass();
83 } 86 }
84 87
(...skipping 18 matching lines...) Expand all
103 DCHECK(scrollbarLayerImpl); 106 DCHECK(scrollbarLayerImpl);
104 DCHECK(scrollLayerImpl); 107 DCHECK(scrollLayerImpl);
105 108
106 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal) 109 if (scrollbarLayerImpl->orientation() == WebKit::WebScrollbar::Horizontal)
107 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl); 110 scrollLayerImpl->setHorizontalScrollbarLayer(scrollbarLayerImpl);
108 else 111 else
109 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl); 112 scrollLayerImpl->setVerticalScrollbarLayer(scrollbarLayerImpl);
110 } 113 }
111 114
112 } // namespace cc 115 } // namespace cc
OLDNEW
« cc/layer_tree_host_impl_unittest.cc ('K') | « cc/layer_tree_host_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698