OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_LAYER_TREE_IMPL_H_ |
| 6 #define CC_LAYER_TREE_IMPL_H_ |
| 7 |
| 8 #include "cc/layer_impl.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 class LayerTreeHostImpl; |
| 13 class LayerTreeImpl; |
| 14 class HeadsUpDisplayLayerImpl; |
| 15 |
| 16 class CC_EXPORT LayerTreeImplClient { |
| 17 public: |
| 18 virtual void OnCanDrawStateChangedForTree(LayerTreeImpl*) = 0; |
| 19 |
| 20 protected: |
| 21 virtual ~LayerTreeImplClient() {} |
| 22 }; |
| 23 |
| 24 class CC_EXPORT LayerTreeImpl { |
| 25 public: |
| 26 static scoped_ptr<LayerTreeImpl> create(LayerTreeImplClient* client) |
| 27 { |
| 28 return make_scoped_ptr(new LayerTreeImpl(client)); |
| 29 } |
| 30 virtual ~LayerTreeImpl(); |
| 31 |
| 32 LayerImpl* RootLayer() const { return root_layer_.get(); } |
| 33 void SetRootLayer(scoped_ptr<LayerImpl>); |
| 34 scoped_ptr<LayerImpl> DetachLayerTree(); |
| 35 |
| 36 int source_frame_number() const { return source_frame_number_; } |
| 37 void set_source_frame_number(int frame_number) { source_frame_number_ = frame_
number; } |
| 38 |
| 39 HeadsUpDisplayLayerImpl* hud_layer() { return hud_layer_; } |
| 40 void set_hud_layer(HeadsUpDisplayLayerImpl* layer_impl) { hud_layer_ = layer_i
mpl; } |
| 41 |
| 42 LayerImpl* root_scroll_layer() { return root_scroll_layer_; } |
| 43 void set_root_scroll_layer(LayerImpl* layer_impl) { root_scroll_layer_ = layer
_impl; } |
| 44 |
| 45 LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; } |
| 46 void set_currently_scrolling_layer(LayerImpl* layer_impl) { currently_scrollin
g_layer_ = layer_impl; } |
| 47 |
| 48 protected: |
| 49 LayerTreeImpl(LayerTreeImplClient* client); |
| 50 |
| 51 LayerTreeImplClient* client_; |
| 52 int source_frame_number_; |
| 53 scoped_ptr<LayerImpl> root_layer_; |
| 54 HeadsUpDisplayLayerImpl* hud_layer_; |
| 55 LayerImpl* root_scroll_layer_; |
| 56 LayerImpl* currently_scrolling_layer_; |
| 57 |
| 58 // Persisted state |
| 59 int scrolling_layer_id_from_previous_tree_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 62 }; |
| 63 |
| 64 } |
| 65 |
| 66 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |