| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <unordered_map> | 12 #include <unordered_map> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "cc/animation/animation_registrar.h" |
| 20 #include "cc/animation/layer_tree_mutator.h" |
| 18 #include "cc/base/cc_export.h" | 21 #include "cc/base/cc_export.h" |
| 19 #include "cc/base/synced_property.h" | 22 #include "cc/base/synced_property.h" |
| 20 #include "cc/debug/frame_timing_tracker.h" | 23 #include "cc/debug/frame_timing_tracker.h" |
| 21 #include "cc/debug/micro_benchmark_controller_impl.h" | 24 #include "cc/debug/micro_benchmark_controller_impl.h" |
| 22 #include "cc/input/input_handler.h" | 25 #include "cc/input/input_handler.h" |
| 23 #include "cc/input/scrollbar_animation_controller.h" | 26 #include "cc/input/scrollbar_animation_controller.h" |
| 24 #include "cc/input/top_controls_manager_client.h" | 27 #include "cc/input/top_controls_manager_client.h" |
| 25 #include "cc/layers/layer_collections.h" | 28 #include "cc/layers/layer_collections.h" |
| 26 #include "cc/layers/render_pass_sink.h" | 29 #include "cc/layers/render_pass_sink.h" |
| 27 #include "cc/output/begin_frame_args.h" | 30 #include "cc/output/begin_frame_args.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 class SwapPromise; | 75 class SwapPromise; |
| 73 class SwapPromiseMonitor; | 76 class SwapPromiseMonitor; |
| 74 class SynchronousTaskGraphRunner; | 77 class SynchronousTaskGraphRunner; |
| 75 class TextureMailboxDeleter; | 78 class TextureMailboxDeleter; |
| 76 class TopControlsManager; | 79 class TopControlsManager; |
| 77 class UIResourceBitmap; | 80 class UIResourceBitmap; |
| 78 class UIResourceRequest; | 81 class UIResourceRequest; |
| 79 struct ScrollAndScaleSet; | 82 struct ScrollAndScaleSet; |
| 80 class Viewport; | 83 class Viewport; |
| 81 | 84 |
| 85 using BeginFrameCallbackList = std::vector<base::Closure>; |
| 86 |
| 82 enum class GpuRasterizationStatus { | 87 enum class GpuRasterizationStatus { |
| 83 ON, | 88 ON, |
| 84 ON_FORCED, | 89 ON_FORCED, |
| 85 OFF_DEVICE, | 90 OFF_DEVICE, |
| 86 OFF_VIEWPORT, | 91 OFF_VIEWPORT, |
| 87 MSAA_CONTENT, | 92 MSAA_CONTENT, |
| 88 OFF_CONTENT | 93 OFF_CONTENT |
| 89 }; | 94 }; |
| 90 | 95 |
| 91 // LayerTreeHost->Proxy callback interface. | 96 // LayerTreeHost->Proxy callback interface. |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 459 |
| 455 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; | 460 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
| 456 | 461 |
| 457 size_t memory_allocation_limit_bytes() const; | 462 size_t memory_allocation_limit_bytes() const; |
| 458 | 463 |
| 459 void SetViewportSize(const gfx::Size& device_viewport_size); | 464 void SetViewportSize(const gfx::Size& device_viewport_size); |
| 460 gfx::Size device_viewport_size() const { return device_viewport_size_; } | 465 gfx::Size device_viewport_size() const { return device_viewport_size_; } |
| 461 | 466 |
| 462 const gfx::Transform& DrawTransform() const; | 467 const gfx::Transform& DrawTransform() const; |
| 463 | 468 |
| 469 scoped_ptr<BeginFrameCallbackList> ProcessLayerTreeMutations(); |
| 470 |
| 464 scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); | 471 scoped_ptr<ScrollAndScaleSet> ProcessScrollDeltas(); |
| 465 | 472 |
| 466 void set_max_memory_needed_bytes(size_t bytes) { | 473 void set_max_memory_needed_bytes(size_t bytes) { |
| 467 max_memory_needed_bytes_ = bytes; | 474 max_memory_needed_bytes_ = bytes; |
| 468 } | 475 } |
| 469 | 476 |
| 470 FrameRateCounter* fps_counter() { | 477 FrameRateCounter* fps_counter() { |
| 471 return fps_counter_.get(); | 478 return fps_counter_.get(); |
| 472 } | 479 } |
| 473 MemoryHistory* memory_history() { | 480 MemoryHistory* memory_history() { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 return task_runner_provider_->HasImplThread() | 616 return task_runner_provider_->HasImplThread() |
| 610 ? task_runner_provider_->ImplThreadTaskRunner() | 617 ? task_runner_provider_->ImplThreadTaskRunner() |
| 611 : task_runner_provider_->MainThreadTaskRunner(); | 618 : task_runner_provider_->MainThreadTaskRunner(); |
| 612 } | 619 } |
| 613 | 620 |
| 614 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, | 621 InputHandler::ScrollStatus TryScroll(const gfx::PointF& screen_space_point, |
| 615 InputHandler::ScrollInputType type, | 622 InputHandler::ScrollInputType type, |
| 616 const ScrollTree& scroll_tree, | 623 const ScrollTree& scroll_tree, |
| 617 ScrollNode* scroll_node) const; | 624 ScrollNode* scroll_node) const; |
| 618 | 625 |
| 626 void SetLayerTreeMutator(LayerTreeMutator* mutator); |
| 627 LayerTreeMutator* mutator() { return mutator_; } |
| 628 |
| 619 protected: | 629 protected: |
| 620 LayerTreeHostImpl( | 630 LayerTreeHostImpl( |
| 621 const LayerTreeSettings& settings, | 631 const LayerTreeSettings& settings, |
| 622 LayerTreeHostImplClient* client, | 632 LayerTreeHostImplClient* client, |
| 623 TaskRunnerProvider* task_runner_provider, | 633 TaskRunnerProvider* task_runner_provider, |
| 624 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 634 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 625 SharedBitmapManager* shared_bitmap_manager, | 635 SharedBitmapManager* shared_bitmap_manager, |
| 626 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 636 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 627 TaskGraphRunner* task_graph_runner, | 637 TaskGraphRunner* task_graph_runner, |
| 628 int id); | 638 int id); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 | 852 |
| 843 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 853 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 844 | 854 |
| 845 bool requires_high_res_to_draw_; | 855 bool requires_high_res_to_draw_; |
| 846 bool is_likely_to_require_a_draw_; | 856 bool is_likely_to_require_a_draw_; |
| 847 | 857 |
| 848 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 858 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
| 849 | 859 |
| 850 scoped_ptr<Viewport> viewport_; | 860 scoped_ptr<Viewport> viewport_; |
| 851 | 861 |
| 862 LayerTreeMutator* mutator_; |
| 863 |
| 852 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 864 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 853 }; | 865 }; |
| 854 | 866 |
| 855 } // namespace cc | 867 } // namespace cc |
| 856 | 868 |
| 857 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 869 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |