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 12 matching lines...) Expand all Loading... |
23 #include "cc/input/input_handler.h" | 23 #include "cc/input/input_handler.h" |
24 #include "cc/input/layer_scroll_offset_delegate.h" | 24 #include "cc/input/layer_scroll_offset_delegate.h" |
25 #include "cc/input/top_controls_manager_client.h" | 25 #include "cc/input/top_controls_manager_client.h" |
26 #include "cc/layers/layer_lists.h" | 26 #include "cc/layers/layer_lists.h" |
27 #include "cc/layers/render_pass_sink.h" | 27 #include "cc/layers/render_pass_sink.h" |
28 #include "cc/output/begin_frame_args.h" | 28 #include "cc/output/begin_frame_args.h" |
29 #include "cc/output/managed_memory_policy.h" | 29 #include "cc/output/managed_memory_policy.h" |
30 #include "cc/output/output_surface_client.h" | 30 #include "cc/output/output_surface_client.h" |
31 #include "cc/output/renderer.h" | 31 #include "cc/output/renderer.h" |
32 #include "cc/quads/render_pass.h" | 32 #include "cc/quads/render_pass.h" |
33 #include "cc/resources/rasterizer.h" | |
34 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
35 #include "cc/resources/tile_manager.h" | 34 #include "cc/resources/tile_manager.h" |
36 #include "cc/resources/ui_resource_client.h" | 35 #include "cc/resources/ui_resource_client.h" |
37 #include "cc/scheduler/commit_earlyout_reason.h" | 36 #include "cc/scheduler/commit_earlyout_reason.h" |
38 #include "cc/scheduler/draw_result.h" | 37 #include "cc/scheduler/draw_result.h" |
39 #include "cc/trees/layer_tree_settings.h" | 38 #include "cc/trees/layer_tree_settings.h" |
40 #include "cc/trees/proxy.h" | 39 #include "cc/trees/proxy.h" |
41 #include "skia/ext/refptr.h" | 40 #include "skia/ext/refptr.h" |
42 #include "third_party/skia/include/core/SkColor.h" | 41 #include "third_party/skia/include/core/SkColor.h" |
43 #include "ui/gfx/geometry/rect.h" | 42 #include "ui/gfx/geometry/rect.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 void set_gpu_rasterization_status( | 319 void set_gpu_rasterization_status( |
321 GpuRasterizationStatus gpu_rasterization_status) { | 320 GpuRasterizationStatus gpu_rasterization_status) { |
322 gpu_rasterization_status_ = gpu_rasterization_status; | 321 gpu_rasterization_status_ = gpu_rasterization_status; |
323 } | 322 } |
324 | 323 |
325 bool create_low_res_tiling() const { | 324 bool create_low_res_tiling() const { |
326 return settings_.create_low_res_tiling && !use_gpu_rasterization_; | 325 return settings_.create_low_res_tiling && !use_gpu_rasterization_; |
327 } | 326 } |
328 ResourcePool* resource_pool() { return resource_pool_.get(); } | 327 ResourcePool* resource_pool() { return resource_pool_.get(); } |
329 Renderer* renderer() { return renderer_.get(); } | 328 Renderer* renderer() { return renderer_.get(); } |
330 Rasterizer* rasterizer() { return rasterizer_.get(); } | |
331 const RendererCapabilitiesImpl& GetRendererCapabilities() const; | 329 const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
332 | 330 |
333 virtual bool SwapBuffers(const FrameData& frame); | 331 virtual bool SwapBuffers(const FrameData& frame); |
334 virtual void WillBeginImplFrame(const BeginFrameArgs& args); | 332 virtual void WillBeginImplFrame(const BeginFrameArgs& args); |
335 void DidModifyTilePriorities(); | 333 void DidModifyTilePriorities(); |
336 | 334 |
337 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 335 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
338 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 336 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
339 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 337 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
340 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 338 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 | 506 |
509 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for | 507 // TODO(weiliangc): Replace RequiresHighResToDraw with scheduler waits for |
510 // ReadyToDraw. crbug.com/469175 | 508 // ReadyToDraw. crbug.com/469175 |
511 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 509 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } |
512 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 510 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } |
513 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 511 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
514 | 512 |
515 // Only valid for synchronous (non-scheduled) single-threaded case. | 513 // Only valid for synchronous (non-scheduled) single-threaded case. |
516 void SynchronouslyInitializeAllTiles(); | 514 void SynchronouslyInitializeAllTiles(); |
517 | 515 |
518 virtual scoped_ptr<Rasterizer> CreateRasterizer(); | |
519 virtual void CreateResourceAndTileTaskWorkerPool( | 516 virtual void CreateResourceAndTileTaskWorkerPool( |
520 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 517 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
521 scoped_ptr<ResourcePool>* resource_pool, | 518 scoped_ptr<ResourcePool>* resource_pool, |
522 scoped_ptr<ResourcePool>* staging_resource_pool); | 519 scoped_ptr<ResourcePool>* staging_resource_pool); |
523 | 520 |
524 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } | 521 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } |
525 | 522 |
526 FrameTimingTracker* frame_timing_tracker() { | 523 FrameTimingTracker* frame_timing_tracker() { |
527 return frame_timing_tracker_.get(); | 524 return frame_timing_tracker_.get(); |
528 } | 525 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 scoped_ptr<OutputSurface> output_surface_; | 629 scoped_ptr<OutputSurface> output_surface_; |
633 | 630 |
634 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- | 631 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
635 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). | 632 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
636 // |tile_manager_| can also be NULL when raster_enabled is false. | 633 // |tile_manager_| can also be NULL when raster_enabled is false. |
637 scoped_ptr<ResourceProvider> resource_provider_; | 634 scoped_ptr<ResourceProvider> resource_provider_; |
638 scoped_ptr<TileManager> tile_manager_; | 635 scoped_ptr<TileManager> tile_manager_; |
639 bool use_gpu_rasterization_; | 636 bool use_gpu_rasterization_; |
640 GpuRasterizationStatus gpu_rasterization_status_; | 637 GpuRasterizationStatus gpu_rasterization_status_; |
641 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 638 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
642 scoped_ptr<Rasterizer> rasterizer_; | |
643 scoped_ptr<ResourcePool> resource_pool_; | 639 scoped_ptr<ResourcePool> resource_pool_; |
644 scoped_ptr<ResourcePool> staging_resource_pool_; | 640 scoped_ptr<ResourcePool> staging_resource_pool_; |
645 scoped_ptr<Renderer> renderer_; | 641 scoped_ptr<Renderer> renderer_; |
646 | 642 |
647 GlobalStateThatImpactsTilePriority global_tile_state_; | 643 GlobalStateThatImpactsTilePriority global_tile_state_; |
648 | 644 |
649 // Tree currently being drawn. | 645 // Tree currently being drawn. |
650 scoped_ptr<LayerTreeImpl> active_tree_; | 646 scoped_ptr<LayerTreeImpl> active_tree_; |
651 | 647 |
652 // In impl-side painting mode, tree with possibly incomplete rasterized | 648 // In impl-side painting mode, tree with possibly incomplete rasterized |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 751 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
756 | 752 |
757 scoped_ptr<Viewport> viewport_; | 753 scoped_ptr<Viewport> viewport_; |
758 | 754 |
759 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 755 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
760 }; | 756 }; |
761 | 757 |
762 } // namespace cc | 758 } // namespace cc |
763 | 759 |
764 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 760 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |