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 11 matching lines...) Expand all Loading... |
22 #include "cc/input/input_handler.h" | 22 #include "cc/input/input_handler.h" |
23 #include "cc/input/layer_scroll_offset_delegate.h" | 23 #include "cc/input/layer_scroll_offset_delegate.h" |
24 #include "cc/input/top_controls_manager_client.h" | 24 #include "cc/input/top_controls_manager_client.h" |
25 #include "cc/layers/layer_lists.h" | 25 #include "cc/layers/layer_lists.h" |
26 #include "cc/layers/render_pass_sink.h" | 26 #include "cc/layers/render_pass_sink.h" |
27 #include "cc/output/begin_frame_args.h" | 27 #include "cc/output/begin_frame_args.h" |
28 #include "cc/output/managed_memory_policy.h" | 28 #include "cc/output/managed_memory_policy.h" |
29 #include "cc/output/output_surface_client.h" | 29 #include "cc/output/output_surface_client.h" |
30 #include "cc/output/renderer.h" | 30 #include "cc/output/renderer.h" |
31 #include "cc/quads/render_pass.h" | 31 #include "cc/quads/render_pass.h" |
| 32 #include "cc/resources/rasterizer.h" |
32 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
33 #include "cc/resources/tile_manager.h" | 34 #include "cc/resources/tile_manager.h" |
34 #include "cc/scheduler/commit_earlyout_reason.h" | 35 #include "cc/scheduler/commit_earlyout_reason.h" |
35 #include "cc/scheduler/draw_result.h" | 36 #include "cc/scheduler/draw_result.h" |
36 #include "skia/ext/refptr.h" | 37 #include "skia/ext/refptr.h" |
37 #include "third_party/skia/include/core/SkColor.h" | 38 #include "third_party/skia/include/core/SkColor.h" |
38 #include "ui/gfx/geometry/rect.h" | 39 #include "ui/gfx/geometry/rect.h" |
39 | 40 |
40 namespace cc { | 41 namespace cc { |
41 | 42 |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 void GetPictureLayerImplPairs(std::vector<PictureLayerImpl::Pair>* layers, | 493 void GetPictureLayerImplPairs(std::vector<PictureLayerImpl::Pair>* layers, |
493 bool need_valid_tile_priorities) const; | 494 bool need_valid_tile_priorities) const; |
494 | 495 |
495 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 496 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } |
496 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 497 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } |
497 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 498 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
498 | 499 |
499 // Only valid for synchronous (non-scheduled) single-threaded case. | 500 // Only valid for synchronous (non-scheduled) single-threaded case. |
500 void SynchronouslyInitializeAllTiles(); | 501 void SynchronouslyInitializeAllTiles(); |
501 | 502 |
| 503 virtual scoped_ptr<Rasterizer> CreateRasterizer(); |
502 virtual void CreateResourceAndTileTaskWorkerPool( | 504 virtual void CreateResourceAndTileTaskWorkerPool( |
503 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 505 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
504 scoped_ptr<ResourcePool>* resource_pool, | 506 scoped_ptr<ResourcePool>* resource_pool, |
505 scoped_ptr<ResourcePool>* staging_resource_pool); | 507 scoped_ptr<ResourcePool>* staging_resource_pool); |
506 | 508 |
507 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } | 509 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } |
508 | 510 |
509 protected: | 511 protected: |
510 LayerTreeHostImpl( | 512 LayerTreeHostImpl( |
511 const LayerTreeSettings& settings, | 513 const LayerTreeSettings& settings, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 606 |
605 scoped_ptr<OutputSurface> output_surface_; | 607 scoped_ptr<OutputSurface> output_surface_; |
606 | 608 |
607 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- | 609 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
608 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). | 610 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
609 scoped_ptr<ResourceProvider> resource_provider_; | 611 scoped_ptr<ResourceProvider> resource_provider_; |
610 scoped_ptr<TileManager> tile_manager_; | 612 scoped_ptr<TileManager> tile_manager_; |
611 bool use_gpu_rasterization_; | 613 bool use_gpu_rasterization_; |
612 GpuRasterizationStatus gpu_rasterization_status_; | 614 GpuRasterizationStatus gpu_rasterization_status_; |
613 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 615 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
| 616 scoped_ptr<Rasterizer> rasterizer_; |
614 scoped_ptr<ResourcePool> resource_pool_; | 617 scoped_ptr<ResourcePool> resource_pool_; |
615 scoped_ptr<ResourcePool> staging_resource_pool_; | 618 scoped_ptr<ResourcePool> staging_resource_pool_; |
616 scoped_ptr<Renderer> renderer_; | 619 scoped_ptr<Renderer> renderer_; |
617 | 620 |
618 GlobalStateThatImpactsTilePriority global_tile_state_; | 621 GlobalStateThatImpactsTilePriority global_tile_state_; |
619 | 622 |
620 // Tree currently being drawn. | 623 // Tree currently being drawn. |
621 scoped_ptr<LayerTreeImpl> active_tree_; | 624 scoped_ptr<LayerTreeImpl> active_tree_; |
622 | 625 |
623 // In impl-side painting mode, tree with possibly incomplete rasterized | 626 // In impl-side painting mode, tree with possibly incomplete rasterized |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 729 |
727 bool requires_high_res_to_draw_; | 730 bool requires_high_res_to_draw_; |
728 bool required_for_draw_tile_is_top_of_raster_queue_; | 731 bool required_for_draw_tile_is_top_of_raster_queue_; |
729 | 732 |
730 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 733 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
731 }; | 734 }; |
732 | 735 |
733 } // namespace cc | 736 } // namespace cc |
734 | 737 |
735 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 738 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |