| 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_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 size_t limit_bytes, | 101 size_t limit_bytes, |
| 102 int priority_cutoff) = 0; | 102 int priority_cutoff) = 0; |
| 103 virtual bool IsInsideDraw() = 0; | 103 virtual bool IsInsideDraw() = 0; |
| 104 virtual void RenewTreePriority() = 0; | 104 virtual void RenewTreePriority() = 0; |
| 105 virtual void PostDelayedScrollbarFadeOnImplThread( | 105 virtual void PostDelayedScrollbarFadeOnImplThread( |
| 106 const base::Closure& start_fade, | 106 const base::Closure& start_fade, |
| 107 base::TimeDelta delay) = 0; | 107 base::TimeDelta delay) = 0; |
| 108 virtual void DidActivateSyncTree() = 0; | 108 virtual void DidActivateSyncTree() = 0; |
| 109 virtual void DidPrepareTiles() = 0; | 109 virtual void DidPrepareTiles() = 0; |
| 110 | 110 |
| 111 // Called when page scale animation has completed on the impl thread. |
| 112 virtual void DidCompletePageScaleAnimationOnImplThread() = 0; |
| 113 |
| 111 protected: | 114 protected: |
| 112 virtual ~LayerTreeHostImplClient() {} | 115 virtual ~LayerTreeHostImplClient() {} |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 118 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 116 // state. | 119 // state. |
| 117 class CC_EXPORT LayerTreeHostImpl | 120 class CC_EXPORT LayerTreeHostImpl |
| 118 : public InputHandler, | 121 : public InputHandler, |
| 119 public RendererClient, | 122 public RendererClient, |
| 120 public TileManagerClient, | 123 public TileManagerClient, |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void SetNeedsRedraw(); | 352 void SetNeedsRedraw(); |
| 350 | 353 |
| 351 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; | 354 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
| 352 | 355 |
| 353 size_t memory_allocation_limit_bytes() const; | 356 size_t memory_allocation_limit_bytes() const; |
| 354 int memory_allocation_priority_cutoff() const; | 357 int memory_allocation_priority_cutoff() const; |
| 355 | 358 |
| 356 void SetViewportSize(const gfx::Size& device_viewport_size); | 359 void SetViewportSize(const gfx::Size& device_viewport_size); |
| 357 gfx::Size device_viewport_size() const { return device_viewport_size_; } | 360 gfx::Size device_viewport_size() const { return device_viewport_size_; } |
| 358 | 361 |
| 359 void SetOverhangUIResource(UIResourceId overhang_ui_resource_id, | |
| 360 const gfx::Size& overhang_ui_resource_size); | |
| 361 | |
| 362 void SetDeviceScaleFactor(float device_scale_factor); | 362 void SetDeviceScaleFactor(float device_scale_factor); |
| 363 float device_scale_factor() const { return device_scale_factor_; } | 363 float device_scale_factor() const { return device_scale_factor_; } |
| 364 | 364 |
| 365 void SetPageScaleOnActiveTree(float page_scale_factor); | 365 void SetPageScaleOnActiveTree(float page_scale_factor); |
| 366 | 366 |
| 367 const gfx::Transform& DrawTransform() const; | 367 const gfx::Transform& DrawTransform() const; |
| 368 | 368 |
| 369 scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); | 369 scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); |
| 370 | 370 |
| 371 bool needs_animate_layers() const { | 371 bool needs_animate_layers() const { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 // Viewport size passed in from the main thread, in physical pixels. This | 679 // Viewport size passed in from the main thread, in physical pixels. This |
| 680 // value is the default size for all concepts of physical viewport (draw | 680 // value is the default size for all concepts of physical viewport (draw |
| 681 // viewport, scrolling viewport and device viewport), but it can be | 681 // viewport, scrolling viewport and device viewport), but it can be |
| 682 // overridden. | 682 // overridden. |
| 683 gfx::Size device_viewport_size_; | 683 gfx::Size device_viewport_size_; |
| 684 | 684 |
| 685 // Conversion factor from CSS pixels to physical pixels when | 685 // Conversion factor from CSS pixels to physical pixels when |
| 686 // pageScaleFactor=1. | 686 // pageScaleFactor=1. |
| 687 float device_scale_factor_; | 687 float device_scale_factor_; |
| 688 | 688 |
| 689 // UI resource to use for drawing overhang gutters. | |
| 690 UIResourceId overhang_ui_resource_id_; | |
| 691 gfx::Size overhang_ui_resource_size_; | |
| 692 | |
| 693 // Optional top-level constraints that can be set by the OutputSurface. | 689 // Optional top-level constraints that can be set by the OutputSurface. |
| 694 // - external_transform_ applies a transform above the root layer | 690 // - external_transform_ applies a transform above the root layer |
| 695 // - external_viewport_ is used DrawProperties, tile management and | 691 // - external_viewport_ is used DrawProperties, tile management and |
| 696 // glViewport/window projection matrix. | 692 // glViewport/window projection matrix. |
| 697 // - external_clip_ specifies a top-level clip rect | 693 // - external_clip_ specifies a top-level clip rect |
| 698 // - viewport_rect_for_tile_priority_ is the rect in view space used for | 694 // - viewport_rect_for_tile_priority_ is the rect in view space used for |
| 699 // tiling priority. | 695 // tiling priority. |
| 700 gfx::Transform external_transform_; | 696 gfx::Transform external_transform_; |
| 701 gfx::Rect external_viewport_; | 697 gfx::Rect external_viewport_; |
| 702 gfx::Rect external_clip_; | 698 gfx::Rect external_clip_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 730 | 726 |
| 731 bool requires_high_res_to_draw_; | 727 bool requires_high_res_to_draw_; |
| 732 bool required_for_draw_tile_is_top_of_raster_queue_; | 728 bool required_for_draw_tile_is_top_of_raster_queue_; |
| 733 | 729 |
| 734 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 730 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 735 }; | 731 }; |
| 736 | 732 |
| 737 } // namespace cc | 733 } // namespace cc |
| 738 | 734 |
| 739 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 735 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |