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_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 30 matching lines...) Expand all Loading... |
41 class LayerTreeSettings; | 41 class LayerTreeSettings; |
42 class MemoryHistory; | 42 class MemoryHistory; |
43 class OutputSurface; | 43 class OutputSurface; |
44 class PaintTimeCounter; | 44 class PaintTimeCounter; |
45 class PictureLayerImpl; | 45 class PictureLayerImpl; |
46 class Proxy; | 46 class Proxy; |
47 class ResourceProvider; | 47 class ResourceProvider; |
48 class TileManager; | 48 class TileManager; |
49 class UIResourceRequest; | 49 class UIResourceRequest; |
50 struct RendererCapabilities; | 50 struct RendererCapabilities; |
| 51 struct SelectionHandle; |
51 | 52 |
52 typedef std::list<UIResourceRequest> UIResourceRequestQueue; | 53 typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
53 | 54 |
54 class CC_EXPORT LayerTreeImpl { | 55 class CC_EXPORT LayerTreeImpl { |
55 public: | 56 public: |
56 static scoped_ptr<LayerTreeImpl> create( | 57 static scoped_ptr<LayerTreeImpl> create( |
57 LayerTreeHostImpl* layer_tree_host_impl) { | 58 LayerTreeHostImpl* layer_tree_host_impl) { |
58 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); | 59 return make_scoped_ptr(new LayerTreeImpl(layer_tree_host_impl)); |
59 } | 60 } |
60 virtual ~LayerTreeImpl(); | 61 virtual ~LayerTreeImpl(); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 257 } |
257 | 258 |
258 LayerImpl* FindFirstScrollingLayerThatIsHitByPoint( | 259 LayerImpl* FindFirstScrollingLayerThatIsHitByPoint( |
259 const gfx::PointF& screen_space_point); | 260 const gfx::PointF& screen_space_point); |
260 | 261 |
261 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); | 262 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); |
262 | 263 |
263 LayerImpl* FindLayerThatIsHitByPointInTouchHandlerRegion( | 264 LayerImpl* FindLayerThatIsHitByPointInTouchHandlerRegion( |
264 const gfx::PointF& screen_space_point); | 265 const gfx::PointF& screen_space_point); |
265 | 266 |
| 267 void RegisterSelection(const LayerSelectionBound& anchor, |
| 268 const LayerSelectionBound& focus); |
| 269 |
| 270 // Compute the current selection handle location and visbility with respect to |
| 271 // the viewport. |
| 272 void GetViewportSelection(ViewportSelectionBound* anchor, |
| 273 ViewportSelectionBound* focus); |
| 274 |
266 void RegisterPictureLayerImpl(PictureLayerImpl* layer); | 275 void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
267 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); | 276 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
268 | 277 |
269 protected: | 278 protected: |
270 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); | 279 explicit LayerTreeImpl(LayerTreeHostImpl* layer_tree_host_impl); |
271 void ReleaseResourcesRecursive(LayerImpl* current); | 280 void ReleaseResourcesRecursive(LayerImpl* current); |
| 281 void ClearSelection(); |
272 | 282 |
273 LayerTreeHostImpl* layer_tree_host_impl_; | 283 LayerTreeHostImpl* layer_tree_host_impl_; |
274 int source_frame_number_; | 284 int source_frame_number_; |
275 scoped_ptr<LayerImpl> root_layer_; | 285 scoped_ptr<LayerImpl> root_layer_; |
276 HeadsUpDisplayLayerImpl* hud_layer_; | 286 HeadsUpDisplayLayerImpl* hud_layer_; |
277 LayerImpl* currently_scrolling_layer_; | 287 LayerImpl* currently_scrolling_layer_; |
278 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 288 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
279 scoped_ptr<LayerScrollOffsetDelegateProxy> | 289 scoped_ptr<LayerScrollOffsetDelegateProxy> |
280 inner_viewport_scroll_delegate_proxy_; | 290 inner_viewport_scroll_delegate_proxy_; |
281 scoped_ptr<LayerScrollOffsetDelegateProxy> | 291 scoped_ptr<LayerScrollOffsetDelegateProxy> |
282 outer_viewport_scroll_delegate_proxy_; | 292 outer_viewport_scroll_delegate_proxy_; |
283 SkColor background_color_; | 293 SkColor background_color_; |
284 bool has_transparent_background_; | 294 bool has_transparent_background_; |
285 | 295 |
286 LayerImpl* page_scale_layer_; | 296 LayerImpl* page_scale_layer_; |
287 LayerImpl* inner_viewport_scroll_layer_; | 297 LayerImpl* inner_viewport_scroll_layer_; |
288 LayerImpl* outer_viewport_scroll_layer_; | 298 LayerImpl* outer_viewport_scroll_layer_; |
289 | 299 |
| 300 LayerSelectionBound selection_anchor_; |
| 301 LayerSelectionBound selection_focus_; |
| 302 |
290 float page_scale_factor_; | 303 float page_scale_factor_; |
291 float page_scale_delta_; | 304 float page_scale_delta_; |
292 float sent_page_scale_delta_; | 305 float sent_page_scale_delta_; |
293 float min_page_scale_factor_; | 306 float min_page_scale_factor_; |
294 float max_page_scale_factor_; | 307 float max_page_scale_factor_; |
295 | 308 |
296 typedef base::hash_map<int, LayerImpl*> LayerIdMap; | 309 typedef base::hash_map<int, LayerImpl*> LayerIdMap; |
297 LayerIdMap layer_id_map_; | 310 LayerIdMap layer_id_map_; |
298 | 311 |
299 std::vector<LayerImpl*> layers_with_copy_output_request_; | 312 std::vector<LayerImpl*> layers_with_copy_output_request_; |
(...skipping 21 matching lines...) Expand all Loading... |
321 | 334 |
322 int render_surface_layer_list_id_; | 335 int render_surface_layer_list_id_; |
323 | 336 |
324 private: | 337 private: |
325 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 338 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
326 }; | 339 }; |
327 | 340 |
328 } // namespace cc | 341 } // namespace cc |
329 | 342 |
330 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 343 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |