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