| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 127 |
| 126 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, | 128 static LayerImpl* get_layer_as_raw_ptr(const LayerImplList& layers, |
| 127 size_t index) { | 129 size_t index) { |
| 128 return layers[index]; | 130 return layers[index]; |
| 129 } | 131 } |
| 130 | 132 |
| 131 struct ScrollUpdateInfo { | 133 struct ScrollUpdateInfo { |
| 132 int layer_id; | 134 int layer_id; |
| 133 gfx::Vector2d scroll_delta; | 135 gfx::Vector2d scroll_delta; |
| 134 }; | 136 }; |
| 137 |
| 138 struct CompositeTimingInfo { |
| 139 CompositeTimingInfo(); |
| 140 ~CompositeTimingInfo(); |
| 141 int64_t rect_id; |
| 142 std::vector<std::pair<int, base::TimeTicks> > timestamps; |
| 143 }; |
| 135 }; | 144 }; |
| 136 | 145 |
| 137 struct CC_EXPORT ScrollAndScaleSet { | 146 struct CC_EXPORT ScrollAndScaleSet { |
| 138 ScrollAndScaleSet(); | 147 ScrollAndScaleSet(); |
| 139 ~ScrollAndScaleSet(); | 148 ~ScrollAndScaleSet(); |
| 140 | 149 |
| 141 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; | 150 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; |
| 142 float page_scale_delta; | 151 float page_scale_delta; |
| 143 float top_controls_delta; | 152 float top_controls_delta; |
| 144 ScopedPtrVector<SwapPromise> swap_promises; | 153 ScopedPtrVector<SwapPromise> swap_promises; |
| 145 }; | 154 }; |
| 146 | 155 |
| 156 struct CC_EXPORT CompositeTimingSet { |
| 157 CompositeTimingSet(); |
| 158 ~CompositeTimingSet(); |
| 159 |
| 160 std::vector<LayerTreeHostCommon::CompositeTimingInfo> composites; |
| 161 }; |
| 162 |
| 163 typedef std::vector<std::pair<int64_t, gfx::Rect> > |
| 164 SmoothnessTimingRequestsType; |
| 165 |
| 147 template <typename LayerType> | 166 template <typename LayerType> |
| 148 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( | 167 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( |
| 149 LayerType* layer, | 168 LayerType* layer, |
| 150 int target_surface_layer_id) { | 169 int target_surface_layer_id) { |
| 151 // A layer will either contribute its own content, or its render surface's | 170 // A layer will either contribute its own content, or its render surface's |
| 152 // content, to the target surface. The layer contributes its surface's content | 171 // content, to the target surface. The layer contributes its surface's content |
| 153 // when both the following are true: | 172 // when both the following are true: |
| 154 // (1) The layer actually has a render surface, and | 173 // (1) The layer actually has a render surface, and |
| 155 // (2) The layer's render surface is not the same as the target surface. | 174 // (2) The layer's render surface is not the same as the target surface. |
| 156 // | 175 // |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 false, | 267 false, |
| 249 render_surface_layer_list, | 268 render_surface_layer_list, |
| 250 0) { | 269 0) { |
| 251 DCHECK(root_layer); | 270 DCHECK(root_layer); |
| 252 DCHECK(render_surface_layer_list); | 271 DCHECK(render_surface_layer_list); |
| 253 } | 272 } |
| 254 | 273 |
| 255 } // namespace cc | 274 } // namespace cc |
| 256 | 275 |
| 257 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ | 276 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ |
| OLD | NEW |