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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 bool IsSingleThreaded() const; | 420 bool IsSingleThreaded() const; |
420 bool IsThreaded() const; | 421 bool IsThreaded() const; |
421 bool IsRemoteServer() const; | 422 bool IsRemoteServer() const; |
422 bool IsRemoteClient() const; | 423 bool IsRemoteClient() const; |
423 void BuildPropertyTreesForTesting(); | 424 void BuildPropertyTreesForTesting(); |
424 | 425 |
425 ImageSerializationProcessor* image_serialization_processor() const { | 426 ImageSerializationProcessor* image_serialization_processor() const { |
426 return image_serialization_processor_; | 427 return image_serialization_processor_; |
427 } | 428 } |
428 | 429 |
| 430 EnginePictureCache* engine_picture_cache() const { |
| 431 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; |
| 432 } |
| 433 |
| 434 ClientPictureCache* client_picture_cache() const { |
| 435 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; |
| 436 } |
| 437 |
429 void ReportFixedRasterScaleUseCounters( | 438 void ReportFixedRasterScaleUseCounters( |
430 bool has_fixed_raster_scale_blurry_content, | 439 bool has_fixed_raster_scale_blurry_content, |
431 bool has_fixed_raster_scale_potential_performance_regression); | 440 bool has_fixed_raster_scale_potential_performance_regression); |
432 | 441 |
433 protected: | 442 protected: |
434 LayerTreeHost(InitParams* params, CompositorMode mode); | 443 LayerTreeHost(InitParams* params, CompositorMode mode); |
435 void InitializeThreaded( | 444 void InitializeThreaded( |
436 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 445 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
437 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 446 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
438 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 447 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
439 void InitializeSingleThreaded( | 448 void InitializeSingleThreaded( |
440 LayerTreeHostSingleThreadClient* single_thread_client, | 449 LayerTreeHostSingleThreadClient* single_thread_client, |
441 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 450 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
442 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 451 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
443 void InitializeRemoteServer( | 452 void InitializeRemoteServer( |
444 RemoteProtoChannel* remote_proto_channel, | 453 RemoteProtoChannel* remote_proto_channel, |
445 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 454 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
446 void InitializeRemoteClient( | 455 void InitializeRemoteClient( |
447 RemoteProtoChannel* remote_proto_channel, | 456 RemoteProtoChannel* remote_proto_channel, |
448 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 457 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
449 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 458 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
450 void InitializeForTesting( | 459 void InitializeForTesting( |
451 std::unique_ptr<TaskRunnerProvider> task_runner_provider, | 460 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
452 std::unique_ptr<Proxy> proxy_for_testing, | 461 std::unique_ptr<Proxy> proxy_for_testing, |
453 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 462 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
| 463 void InitializePictureCacheForTesting(); |
454 void SetOutputSurfaceLostForTesting(bool is_lost) { | 464 void SetOutputSurfaceLostForTesting(bool is_lost) { |
455 output_surface_lost_ = is_lost; | 465 output_surface_lost_ = is_lost; |
456 } | 466 } |
457 void SetTaskRunnerProviderForTesting( | 467 void SetTaskRunnerProviderForTesting( |
458 std::unique_ptr<TaskRunnerProvider> task_runner_provider); | 468 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
459 | 469 |
460 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 470 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
461 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 471 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
462 // created in CreateLayerTreeHostImpl(). | 472 // created in CreateLayerTreeHostImpl(). |
463 SharedBitmapManager* shared_bitmap_manager() const { | 473 SharedBitmapManager* shared_bitmap_manager() const { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 587 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
578 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 588 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
579 | 589 |
580 LayerSelection selection_; | 590 LayerSelection selection_; |
581 | 591 |
582 SharedBitmapManager* shared_bitmap_manager_; | 592 SharedBitmapManager* shared_bitmap_manager_; |
583 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 593 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
584 TaskGraphRunner* task_graph_runner_; | 594 TaskGraphRunner* task_graph_runner_; |
585 | 595 |
586 ImageSerializationProcessor* image_serialization_processor_; | 596 ImageSerializationProcessor* image_serialization_processor_; |
| 597 std::unique_ptr<EnginePictureCache> engine_picture_cache_; |
| 598 std::unique_ptr<ClientPictureCache> client_picture_cache_; |
587 | 599 |
588 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; | 600 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
589 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 601 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
590 | 602 |
591 PropertyTrees property_trees_; | 603 PropertyTrees property_trees_; |
592 | 604 |
593 using LayerIdMap = std::unordered_map<int, Layer*>; | 605 using LayerIdMap = std::unordered_map<int, Layer*>; |
594 LayerIdMap layer_id_map_; | 606 LayerIdMap layer_id_map_; |
595 // Set of layers that need to push properties. | 607 // Set of layers that need to push properties. |
596 std::unordered_set<Layer*> layers_that_should_push_properties_; | 608 std::unordered_set<Layer*> layers_that_should_push_properties_; |
597 | 609 |
598 uint32_t surface_id_namespace_; | 610 uint32_t surface_id_namespace_; |
599 uint32_t next_surface_sequence_; | 611 uint32_t next_surface_sequence_; |
600 | 612 |
601 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 613 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
602 }; | 614 }; |
603 | 615 |
604 } // namespace cc | 616 } // namespace cc |
605 | 617 |
606 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 618 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |