OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_IMPL_H_ |
6 #define CC_LAYER_TREE_IMPL_H_ | 6 #define CC_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; } | 87 const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; } |
88 void set_root_scroll_layer(LayerImpl* layer_impl) { root_scroll_layer_ = layer _impl; } | 88 void set_root_scroll_layer(LayerImpl* layer_impl) { root_scroll_layer_ = layer _impl; } |
89 | 89 |
90 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } | 90 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } |
91 void set_currently_scrolling_layer(LayerImpl* layer_impl) { currently_scrollin g_layer_ = layer_impl; } | 91 void set_currently_scrolling_layer(LayerImpl* layer_impl) { currently_scrollin g_layer_ = layer_impl; } |
92 | 92 |
93 void ClearCurrentlyScrollingLayer(); | 93 void ClearCurrentlyScrollingLayer(); |
94 | 94 |
95 void UpdateMaxScrollOffset(); | 95 void UpdateMaxScrollOffset(); |
96 | 96 |
97 SkColor background_color() const { return background_color_; } | |
98 void set_background_color(SkColor color) { background_color_ = color; } | |
99 | |
100 bool has_transparent_background() const { return has_transparent_background_; } | |
danakj
2013/01/04 22:14:29
80 cols
| |
101 void set_has_transparent_background(bool transparent) { | |
102 has_transparent_background_ = transparent; | |
103 } | |
104 | |
97 // Updates draw properties and render surface layer list | 105 // Updates draw properties and render surface layer list |
98 void UpdateDrawProperties(); | 106 void UpdateDrawProperties(); |
99 | 107 |
100 void ClearRenderSurfaces(); | 108 void ClearRenderSurfaces(); |
101 | 109 |
102 const LayerList& RenderSurfaceLayerList() const; | 110 const LayerList& RenderSurfaceLayerList() const; |
103 | 111 |
104 gfx::Size ContentSize() const; | 112 gfx::Size ContentSize() const; |
105 | 113 |
106 LayerImpl* LayerById(int id); | 114 LayerImpl* LayerById(int id); |
107 | 115 |
108 // These should be called by LayerImpl's ctor/dtor. | 116 // These should be called by LayerImpl's ctor/dtor. |
109 void RegisterLayer(LayerImpl* layer); | 117 void RegisterLayer(LayerImpl* layer); |
110 void UnregisterLayer(LayerImpl* layer); | 118 void UnregisterLayer(LayerImpl* layer); |
111 | 119 |
112 AnimationRegistrar* animationRegistrar() const; | 120 AnimationRegistrar* animationRegistrar() const; |
113 | 121 |
114 protected: | 122 protected: |
115 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 123 LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
116 | 124 |
117 LayerTreeHostImpl* layer_tree_host_impl_; | 125 LayerTreeHostImpl* layer_tree_host_impl_; |
118 int source_frame_number_; | 126 int source_frame_number_; |
119 scoped_ptr<LayerImpl> root_layer_; | 127 scoped_ptr<LayerImpl> root_layer_; |
120 HeadsUpDisplayLayerImpl* hud_layer_; | 128 HeadsUpDisplayLayerImpl* hud_layer_; |
121 LayerImpl* root_scroll_layer_; | 129 LayerImpl* root_scroll_layer_; |
122 LayerImpl* currently_scrolling_layer_; | 130 LayerImpl* currently_scrolling_layer_; |
131 SkColor background_color_; | |
132 bool has_transparent_background_; | |
123 | 133 |
124 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 134 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
125 LayerIdMap layer_id_map_; | 135 LayerIdMap layer_id_map_; |
126 | 136 |
127 // Persisted state | 137 // Persisted state |
128 int scrolling_layer_id_from_previous_tree_; | 138 int scrolling_layer_id_from_previous_tree_; |
129 | 139 |
130 // List of visible layers for the most recently prepared frame. Used for | 140 // List of visible layers for the most recently prepared frame. Used for |
131 // rendering and input event hit testing. | 141 // rendering and input event hit testing. |
132 LayerList render_surface_layer_list_; | 142 LayerList render_surface_layer_list_; |
133 | 143 |
134 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 144 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
135 }; | 145 }; |
136 | 146 |
137 } | 147 } |
138 | 148 |
139 #endif // CC_LAYER_TREE_IMPL_H_ | 149 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |