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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 OutputSurface* output_surface() const { return output_surface_.get(); } | 314 OutputSurface* output_surface() const { return output_surface_.get(); } |
315 | 315 |
316 std::string LayerTreeAsJson() const; | 316 std::string LayerTreeAsJson() const; |
317 | 317 |
318 void FinishAllRendering(); | 318 void FinishAllRendering(); |
319 int SourceAnimationFrameNumber() const; | 319 int SourceAnimationFrameNumber() const; |
320 | 320 |
321 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); | 321 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
322 TileManager* tile_manager() { return tile_manager_.get(); } | 322 TileManager* tile_manager() { return tile_manager_.get(); } |
323 | 323 |
324 void set_has_gpu_rasterization_trigger(bool flag) { | 324 void set_has_gpu_rasterization_trigger(bool flag) { |
Stephen White
2015/05/13 19:44:17
This should probably be CamelCased, now that it's
danakj
2015/05/13 19:50:58
this isn't a simple setter anymore, no hacker case
Stephen White
2015/05/13 20:15:20
Done.
| |
325 has_gpu_rasterization_trigger_ = flag; | 325 has_gpu_rasterization_trigger_ = flag; |
326 UpdateGpuRasterizationStatus(); | |
326 } | 327 } |
327 void set_content_is_suitable_for_gpu_rasterization(bool flag) { | 328 void set_content_is_suitable_for_gpu_rasterization(bool flag) { |
Stephen White
2015/05/13 19:44:17
Same here.
danakj
2015/05/13 19:50:58
dittos
Stephen White
2015/05/13 20:15:20
Done.
| |
328 content_is_suitable_for_gpu_rasterization_ = flag; | 329 content_is_suitable_for_gpu_rasterization_ = flag; |
330 UpdateGpuRasterizationStatus(); | |
329 } | 331 } |
330 void UpdateGpuRasterizationStatus(); | 332 void UpdateTreeResourcesIfNeeded(); |
danakj
2015/05/13 19:50:58
UpdateTreeResourcesForGpuRasterizationIfNeeded?
Stephen White
2015/05/13 20:15:20
Done.
| |
331 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } | 333 bool use_gpu_rasterization() const { return use_gpu_rasterization_; } |
332 bool use_msaa() const { return use_msaa_; } | 334 bool use_msaa() const { return use_msaa_; } |
333 | 335 |
334 GpuRasterizationStatus gpu_rasterization_status() const { | 336 GpuRasterizationStatus gpu_rasterization_status() const { |
335 return gpu_rasterization_status_; | 337 return gpu_rasterization_status_; |
336 } | 338 } |
337 | 339 |
338 bool create_low_res_tiling() const { | 340 bool create_low_res_tiling() const { |
339 return settings_.create_low_res_tiling && !use_gpu_rasterization_; | 341 return settings_.create_low_res_tiling && !use_gpu_rasterization_; |
340 } | 342 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 LayerImpl* layer_impl, | 566 LayerImpl* layer_impl, |
565 const gfx::PointF& viewport_point, | 567 const gfx::PointF& viewport_point, |
566 const gfx::Vector2dF& viewport_delta); | 568 const gfx::Vector2dF& viewport_delta); |
567 | 569 |
568 void CreateAndSetRenderer(); | 570 void CreateAndSetRenderer(); |
569 void CreateAndSetTileManager(); | 571 void CreateAndSetTileManager(); |
570 void DestroyTileManager(); | 572 void DestroyTileManager(); |
571 void ReleaseTreeResources(); | 573 void ReleaseTreeResources(); |
572 void RecreateTreeResources(); | 574 void RecreateTreeResources(); |
573 | 575 |
576 void UpdateGpuRasterizationStatus(); | |
577 | |
574 bool IsSynchronousSingleThreaded() const; | 578 bool IsSynchronousSingleThreaded() const; |
575 | 579 |
576 Viewport* viewport() { return viewport_.get(); } | 580 Viewport* viewport() { return viewport_.get(); } |
577 | 581 |
578 // Scroll by preferring to move the outer viewport first, only moving the | 582 // Scroll by preferring to move the outer viewport first, only moving the |
579 // inner if the outer is at its scroll extents. | 583 // inner if the outer is at its scroll extents. |
580 void ScrollViewportBy(gfx::Vector2dF scroll_delta); | 584 void ScrollViewportBy(gfx::Vector2dF scroll_delta); |
581 // Scroll by preferring to move the inner viewport first, only moving the | 585 // Scroll by preferring to move the inner viewport first, only moving the |
582 // outer if the inner is at its scroll extents. | 586 // outer if the inner is at its scroll extents. |
583 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); | 587 void ScrollViewportInnerFirst(gfx::Vector2dF scroll_delta); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
639 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- | 643 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
640 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). | 644 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
641 // |tile_manager_| can also be NULL when raster_enabled is false. | 645 // |tile_manager_| can also be NULL when raster_enabled is false. |
642 scoped_ptr<ResourceProvider> resource_provider_; | 646 scoped_ptr<ResourceProvider> resource_provider_; |
643 scoped_ptr<TileManager> tile_manager_; | 647 scoped_ptr<TileManager> tile_manager_; |
644 bool content_is_suitable_for_gpu_rasterization_; | 648 bool content_is_suitable_for_gpu_rasterization_; |
645 bool has_gpu_rasterization_trigger_; | 649 bool has_gpu_rasterization_trigger_; |
646 bool use_gpu_rasterization_; | 650 bool use_gpu_rasterization_; |
647 bool use_msaa_; | 651 bool use_msaa_; |
648 GpuRasterizationStatus gpu_rasterization_status_; | 652 GpuRasterizationStatus gpu_rasterization_status_; |
653 bool tree_resources_dirty_; | |
danakj
2015/05/13 19:50:58
_for_gpu_rasterization_
Stephen White
2015/05/13 20:15:20
Done.
| |
649 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 654 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
650 scoped_ptr<ResourcePool> resource_pool_; | 655 scoped_ptr<ResourcePool> resource_pool_; |
651 scoped_ptr<ResourcePool> staging_resource_pool_; | 656 scoped_ptr<ResourcePool> staging_resource_pool_; |
652 scoped_ptr<Renderer> renderer_; | 657 scoped_ptr<Renderer> renderer_; |
653 | 658 |
654 GlobalStateThatImpactsTilePriority global_tile_state_; | 659 GlobalStateThatImpactsTilePriority global_tile_state_; |
655 | 660 |
656 // Tree currently being drawn. | 661 // Tree currently being drawn. |
657 scoped_ptr<LayerTreeImpl> active_tree_; | 662 scoped_ptr<LayerTreeImpl> active_tree_; |
658 | 663 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
760 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; | 765 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; |
761 | 766 |
762 scoped_ptr<Viewport> viewport_; | 767 scoped_ptr<Viewport> viewport_; |
763 | 768 |
764 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 769 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
765 }; | 770 }; |
766 | 771 |
767 } // namespace cc | 772 } // namespace cc |
768 | 773 |
769 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 774 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |