OLD | NEW |
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 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/time/time.h" |
13 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
14 #include "cc/base/scoped_ptr_vector.h" | 16 #include "cc/base/scoped_ptr_vector.h" |
15 #include "cc/layers/layer_lists.h" | 17 #include "cc/layers/layer_lists.h" |
16 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
17 #include "ui/gfx/transform.h" | 19 #include "ui/gfx/transform.h" |
18 #include "ui/gfx/vector2d.h" | 20 #include "ui/gfx/vector2d.h" |
19 | 21 |
20 namespace cc { | 22 namespace cc { |
21 | 23 |
22 class LayerImpl; | 24 class LayerImpl; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 126 |
125 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, | 127 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, |
126 size_t index) { | 128 size_t index) { |
127 return layers[index]; | 129 return layers[index]; |
128 } | 130 } |
129 | 131 |
130 struct ScrollUpdateInfo { | 132 struct ScrollUpdateInfo { |
131 int layer_id; | 133 int layer_id; |
132 gfx::Vector2d scroll_delta; | 134 gfx::Vector2d scroll_delta; |
133 }; | 135 }; |
| 136 |
| 137 struct DrawTimingInfo { |
| 138 DrawTimingInfo(); |
| 139 ~DrawTimingInfo(); |
| 140 int64_t rect_id; |
| 141 std::vector<std::pair<int, base::TimeTicks> > timestamps; |
| 142 }; |
134 }; | 143 }; |
135 | 144 |
136 struct CC_EXPORT ScrollAndScaleSet { | 145 struct CC_EXPORT ScrollAndScaleSet { |
137 ScrollAndScaleSet(); | 146 ScrollAndScaleSet(); |
138 ~ScrollAndScaleSet(); | 147 ~ScrollAndScaleSet(); |
139 | 148 |
140 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; | 149 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; |
141 float page_scale_delta; | 150 float page_scale_delta; |
142 }; | 151 }; |
143 | 152 |
| 153 struct CC_EXPORT DrawTimingSet { |
| 154 DrawTimingSet(); |
| 155 ~DrawTimingSet(); |
| 156 |
| 157 std::vector<LayerTreeHostCommon::DrawTimingInfo> draws; |
| 158 }; |
| 159 |
144 template <typename LayerType> | 160 template <typename LayerType> |
145 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( | 161 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( |
146 LayerType* layer, | 162 LayerType* layer, |
147 int target_surface_layer_id) { | 163 int target_surface_layer_id) { |
148 // A layer will either contribute its own content, or its render surface's | 164 // A layer will either contribute its own content, or its render surface's |
149 // content, to the target surface. The layer contributes its surface's content | 165 // content, to the target surface. The layer contributes its surface's content |
150 // when both the following are true: | 166 // when both the following are true: |
151 // (1) The layer actually has a render surface, and | 167 // (1) The layer actually has a render surface, and |
152 // (2) The layer's render surface is not the same as the target surface. | 168 // (2) The layer's render surface is not the same as the target surface. |
153 // | 169 // |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 false, | 261 false, |
246 render_surface_layer_list, | 262 render_surface_layer_list, |
247 0) { | 263 0) { |
248 DCHECK(root_layer); | 264 DCHECK(root_layer); |
249 DCHECK(render_surface_layer_list); | 265 DCHECK(render_surface_layer_list); |
250 } | 266 } |
251 | 267 |
252 } // namespace cc | 268 } // namespace cc |
253 | 269 |
254 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 270 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
OLD | NEW |