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 "base/values.h" |
9 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
10 | 11 |
11 #if defined(COMPILER_GCC) | 12 #if defined(COMPILER_GCC) |
12 namespace BASE_HASH_NAMESPACE { | 13 namespace BASE_HASH_NAMESPACE { |
13 template<> | 14 template<> |
14 struct hash<cc::LayerImpl*> { | 15 struct hash<cc::LayerImpl*> { |
15 size_t operator()(cc::LayerImpl* ptr) const { | 16 size_t operator()(cc::LayerImpl* ptr) const { |
16 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 17 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
17 } | 18 } |
18 }; | 19 }; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void SetNeedsRedraw(); | 71 void SetNeedsRedraw(); |
71 | 72 |
72 // TODO(nduca): These are implemented in cc files temporarily, but will become | 73 // TODO(nduca): These are implemented in cc files temporarily, but will become |
73 // trivial accessors in a followup patch. | 74 // trivial accessors in a followup patch. |
74 const LayerTreeDebugState& debug_state() const; | 75 const LayerTreeDebugState& debug_state() const; |
75 float device_scale_factor() const; | 76 float device_scale_factor() const; |
76 const gfx::Size& device_viewport_size() const; | 77 const gfx::Size& device_viewport_size() const; |
77 const gfx::Size& layout_viewport_size() const; | 78 const gfx::Size& layout_viewport_size() const; |
78 std::string layer_tree_as_text() const; | 79 std::string layer_tree_as_text() const; |
79 DebugRectHistory* debug_rect_history() const; | 80 DebugRectHistory* debug_rect_history() const; |
| 81 scoped_ptr<base::Value> AsValue() const; |
80 | 82 |
81 // Other public methods | 83 // Other public methods |
82 // --------------------------------------------------------------------------- | 84 // --------------------------------------------------------------------------- |
83 LayerImpl* RootLayer() const { return root_layer_.get(); } | 85 LayerImpl* RootLayer() const { return root_layer_.get(); } |
84 void SetRootLayer(scoped_ptr<LayerImpl>); | 86 void SetRootLayer(scoped_ptr<LayerImpl>); |
85 scoped_ptr<LayerImpl> DetachLayerTree(); | 87 scoped_ptr<LayerImpl> DetachLayerTree(); |
86 | 88 |
87 void pushPropertiesTo(LayerTreeImpl*); | 89 void pushPropertiesTo(LayerTreeImpl*); |
88 | 90 |
89 int source_frame_number() const { return source_frame_number_; } | 91 int source_frame_number() const { return source_frame_number_; } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // In impl-side painting mode, this is true when the tree may contain | 225 // In impl-side painting mode, this is true when the tree may contain |
224 // structural differences relative to the active tree. | 226 // structural differences relative to the active tree. |
225 bool needs_full_tree_sync_; | 227 bool needs_full_tree_sync_; |
226 | 228 |
227 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 229 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
228 }; | 230 }; |
229 | 231 |
230 } | 232 } |
231 | 233 |
232 #endif // CC_LAYER_TREE_IMPL_H_ | 234 #endif // CC_LAYER_TREE_IMPL_H_ |
OLD | NEW |