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 22 matching lines...) Expand all Loading... | |
33 #include "cc/input/top_controls_state.h" | 33 #include "cc/input/top_controls_state.h" |
34 #include "cc/layers/layer_collections.h" | 34 #include "cc/layers/layer_collections.h" |
35 #include "cc/layers/layer_list_iterator.h" | 35 #include "cc/layers/layer_list_iterator.h" |
36 #include "cc/output/output_surface.h" | 36 #include "cc/output/output_surface.h" |
37 #include "cc/output/renderer_capabilities.h" | 37 #include "cc/output/renderer_capabilities.h" |
38 #include "cc/output/swap_promise.h" | 38 #include "cc/output/swap_promise.h" |
39 #include "cc/resources/resource_format.h" | 39 #include "cc/resources/resource_format.h" |
40 #include "cc/resources/scoped_ui_resource.h" | 40 #include "cc/resources/scoped_ui_resource.h" |
41 #include "cc/surfaces/surface_sequence.h" | 41 #include "cc/surfaces/surface_sequence.h" |
42 #include "cc/trees/compositor_mode.h" | 42 #include "cc/trees/compositor_mode.h" |
43 #include "cc/trees/layer_tree.h" | |
43 #include "cc/trees/layer_tree_host_client.h" | 44 #include "cc/trees/layer_tree_host_client.h" |
44 #include "cc/trees/layer_tree_settings.h" | 45 #include "cc/trees/layer_tree_settings.h" |
45 #include "cc/trees/mutator_host_client.h" | 46 #include "cc/trees/mutator_host_client.h" |
46 #include "cc/trees/proxy.h" | 47 #include "cc/trees/proxy.h" |
47 #include "cc/trees/swap_promise_monitor.h" | 48 #include "cc/trees/swap_promise_monitor.h" |
48 #include "third_party/skia/include/core/SkColor.h" | 49 #include "third_party/skia/include/core/SkColor.h" |
49 #include "ui/gfx/geometry/rect.h" | 50 #include "ui/gfx/geometry/rect.h" |
50 | 51 |
51 namespace gpu { | 52 namespace gpu { |
52 class GpuMemoryBufferManager; | 53 class GpuMemoryBufferManager; |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 } | 420 } |
420 | 421 |
421 EnginePictureCache* engine_picture_cache() const { | 422 EnginePictureCache* engine_picture_cache() const { |
422 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; | 423 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; |
423 } | 424 } |
424 | 425 |
425 ClientPictureCache* client_picture_cache() const { | 426 ClientPictureCache* client_picture_cache() const { |
426 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; | 427 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; |
427 } | 428 } |
428 | 429 |
430 LayerTree* layer_tree() { return &layer_tree_; } | |
Khushal
2016/07/18 16:59:33
Can you change this to LayerTree* GetLayerTree() c
xingliu
2016/07/19 22:47:38
Done.
| |
431 | |
429 protected: | 432 protected: |
430 LayerTreeHost(InitParams* params, CompositorMode mode); | 433 LayerTreeHost(InitParams* params, CompositorMode mode); |
431 void InitializeThreaded( | 434 void InitializeThreaded( |
432 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 435 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
433 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 436 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
434 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 437 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
435 void InitializeSingleThreaded( | 438 void InitializeSingleThreaded( |
436 LayerTreeHostSingleThreadClient* single_thread_client, | 439 LayerTreeHostSingleThreadClient* single_thread_client, |
437 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 440 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
438 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 441 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 595 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
593 | 596 |
594 PropertyTrees property_trees_; | 597 PropertyTrees property_trees_; |
595 | 598 |
596 using LayerIdMap = std::unordered_map<int, Layer*>; | 599 using LayerIdMap = std::unordered_map<int, Layer*>; |
597 LayerIdMap layer_id_map_; | 600 LayerIdMap layer_id_map_; |
598 | 601 |
599 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>; | 602 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>; |
600 ElementLayersMap element_layers_map_; | 603 ElementLayersMap element_layers_map_; |
601 | 604 |
602 // Set of layers that need to push properties. | |
603 std::unordered_set<Layer*> layers_that_should_push_properties_; | |
604 | |
605 uint32_t surface_client_id_; | 605 uint32_t surface_client_id_; |
606 uint32_t next_surface_sequence_; | 606 uint32_t next_surface_sequence_; |
607 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 607 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
608 | 608 |
609 // Layer tree that hold layers. | |
610 LayerTree layer_tree_; | |
611 | |
609 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 612 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
610 }; | 613 }; |
611 | 614 |
612 } // namespace cc | 615 } // namespace cc |
613 | 616 |
614 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 617 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |