| 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_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "cc/input/event_listener_properties.h" | 27 #include "cc/input/event_listener_properties.h" |
| 28 #include "cc/input/input_handler.h" | 28 #include "cc/input/input_handler.h" |
| 29 #include "cc/input/layer_selection_bound.h" | 29 #include "cc/input/layer_selection_bound.h" |
| 30 #include "cc/input/scrollbar.h" | 30 #include "cc/input/scrollbar.h" |
| 31 #include "cc/input/top_controls_state.h" | 31 #include "cc/input/top_controls_state.h" |
| 32 #include "cc/layers/layer_collections.h" | 32 #include "cc/layers/layer_collections.h" |
| 33 #include "cc/layers/layer_list_iterator.h" | 33 #include "cc/layers/layer_list_iterator.h" |
| 34 #include "cc/output/output_surface.h" | 34 #include "cc/output/output_surface.h" |
| 35 #include "cc/output/renderer_capabilities.h" | 35 #include "cc/output/renderer_capabilities.h" |
| 36 #include "cc/output/swap_promise.h" | 36 #include "cc/output/swap_promise.h" |
| 37 #include "cc/proto/picture_cache.h" |
| 37 #include "cc/resources/resource_format.h" | 38 #include "cc/resources/resource_format.h" |
| 38 #include "cc/resources/scoped_ui_resource.h" | 39 #include "cc/resources/scoped_ui_resource.h" |
| 39 #include "cc/surfaces/surface_sequence.h" | 40 #include "cc/surfaces/surface_sequence.h" |
| 40 #include "cc/trees/compositor_mode.h" | 41 #include "cc/trees/compositor_mode.h" |
| 41 #include "cc/trees/layer_tree_host_client.h" | 42 #include "cc/trees/layer_tree_host_client.h" |
| 42 #include "cc/trees/layer_tree_settings.h" | 43 #include "cc/trees/layer_tree_settings.h" |
| 43 #include "cc/trees/mutator_host_client.h" | 44 #include "cc/trees/mutator_host_client.h" |
| 44 #include "cc/trees/proxy.h" | 45 #include "cc/trees/proxy.h" |
| 45 #include "cc/trees/swap_promise_monitor.h" | 46 #include "cc/trees/swap_promise_monitor.h" |
| 46 #include "third_party/skia/include/core/SkColor.h" | 47 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 bool IsSingleThreaded() const; | 421 bool IsSingleThreaded() const; |
| 421 bool IsThreaded() const; | 422 bool IsThreaded() const; |
| 422 bool IsRemoteServer() const; | 423 bool IsRemoteServer() const; |
| 423 bool IsRemoteClient() const; | 424 bool IsRemoteClient() const; |
| 424 void BuildPropertyTreesForTesting(); | 425 void BuildPropertyTreesForTesting(); |
| 425 | 426 |
| 426 ImageSerializationProcessor* image_serialization_processor() const { | 427 ImageSerializationProcessor* image_serialization_processor() const { |
| 427 return image_serialization_processor_; | 428 return image_serialization_processor_; |
| 428 } | 429 } |
| 429 | 430 |
| 431 EnginePictureCache* engine_picture_cache() const { |
| 432 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; |
| 433 } |
| 434 |
| 435 ClientPictureCache* client_picture_cache() const { |
| 436 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; |
| 437 } |
| 438 |
| 430 void ReportFixedRasterScaleUseCounters( | 439 void ReportFixedRasterScaleUseCounters( |
| 431 bool has_fixed_raster_scale_blurry_content, | 440 bool has_fixed_raster_scale_blurry_content, |
| 432 bool has_fixed_raster_scale_potential_performance_regression); | 441 bool has_fixed_raster_scale_potential_performance_regression); |
| 433 | 442 |
| 434 protected: | 443 protected: |
| 435 LayerTreeHost(InitParams* params, CompositorMode mode); | 444 LayerTreeHost(InitParams* params, CompositorMode mode); |
| 436 void InitializeThreaded( | 445 void InitializeThreaded( |
| 437 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 446 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 438 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 447 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 439 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 448 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
| 440 void InitializeSingleThreaded( | 449 void InitializeSingleThreaded( |
| 441 LayerTreeHostSingleThreadClient* single_thread_client, | 450 LayerTreeHostSingleThreadClient* single_thread_client, |
| 442 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 451 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 443 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 452 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
| 444 void InitializeRemoteServer( | 453 void InitializeRemoteServer( |
| 445 RemoteProtoChannel* remote_proto_channel, | 454 RemoteProtoChannel* remote_proto_channel, |
| 446 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 455 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
| 447 void InitializeRemoteClient( | 456 void InitializeRemoteClient( |
| 448 RemoteProtoChannel* remote_proto_channel, | 457 RemoteProtoChannel* remote_proto_channel, |
| 449 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 458 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 450 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 459 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| 451 void InitializeForTesting( | 460 void InitializeForTesting( |
| 452 std::unique_ptr<TaskRunnerProvider> task_runner_provider, | 461 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
| 453 std::unique_ptr<Proxy> proxy_for_testing, | 462 std::unique_ptr<Proxy> proxy_for_testing, |
| 454 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 463 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
| 464 void InitializePictureCacheForTesting(); |
| 455 void SetOutputSurfaceLostForTesting(bool is_lost) { | 465 void SetOutputSurfaceLostForTesting(bool is_lost) { |
| 456 output_surface_lost_ = is_lost; | 466 output_surface_lost_ = is_lost; |
| 457 } | 467 } |
| 458 void SetTaskRunnerProviderForTesting( | 468 void SetTaskRunnerProviderForTesting( |
| 459 std::unique_ptr<TaskRunnerProvider> task_runner_provider); | 469 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
| 460 | 470 |
| 461 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 471 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
| 462 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 472 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
| 463 // created in CreateLayerTreeHostImpl(). | 473 // created in CreateLayerTreeHostImpl(). |
| 464 SharedBitmapManager* shared_bitmap_manager() const { | 474 SharedBitmapManager* shared_bitmap_manager() const { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 588 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
| 579 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 589 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
| 580 | 590 |
| 581 LayerSelection selection_; | 591 LayerSelection selection_; |
| 582 | 592 |
| 583 SharedBitmapManager* shared_bitmap_manager_; | 593 SharedBitmapManager* shared_bitmap_manager_; |
| 584 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 594 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 585 TaskGraphRunner* task_graph_runner_; | 595 TaskGraphRunner* task_graph_runner_; |
| 586 | 596 |
| 587 ImageSerializationProcessor* image_serialization_processor_; | 597 ImageSerializationProcessor* image_serialization_processor_; |
| 598 std::unique_ptr<EnginePictureCache> engine_picture_cache_; |
| 599 std::unique_ptr<ClientPictureCache> client_picture_cache_; |
| 588 | 600 |
| 589 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; | 601 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
| 590 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 602 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 591 | 603 |
| 592 PropertyTrees property_trees_; | 604 PropertyTrees property_trees_; |
| 593 | 605 |
| 594 using LayerIdMap = std::unordered_map<int, Layer*>; | 606 using LayerIdMap = std::unordered_map<int, Layer*>; |
| 595 LayerIdMap layer_id_map_; | 607 LayerIdMap layer_id_map_; |
| 596 // Set of layers that need to push properties. | 608 // Set of layers that need to push properties. |
| 597 std::unordered_set<Layer*> layers_that_should_push_properties_; | 609 std::unordered_set<Layer*> layers_that_should_push_properties_; |
| 598 | 610 |
| 599 uint32_t surface_id_namespace_; | 611 uint32_t surface_id_namespace_; |
| 600 uint32_t next_surface_sequence_; | 612 uint32_t next_surface_sequence_; |
| 601 | 613 |
| 602 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 614 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 603 }; | 615 }; |
| 604 | 616 |
| 605 } // namespace cc | 617 } // namespace cc |
| 606 | 618 |
| 607 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 619 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |