| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
| 6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Gets the shared bitmap manager for software mode. | 129 // Gets the shared bitmap manager for software mode. |
| 130 virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; | 130 virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; |
| 131 | 131 |
| 132 // Gets the GPU memory buffer manager. | 132 // Gets the GPU memory buffer manager. |
| 133 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; | 133 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; |
| 134 | 134 |
| 135 // Gets the task graph runner. | 135 // Gets the task graph runner. |
| 136 virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0; | 136 virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0; |
| 137 | 137 |
| 138 // Allocate a new client ID for the display compositor. | 138 // Allocate a new client ID for the display compositor. |
| 139 virtual uint32_t AllocateSurfaceClientId() = 0; | 139 virtual cc::FrameSinkId AllocateFrameSinkId() = 0; |
| 140 | 140 |
| 141 // Gets the surface manager. | 141 // Gets the surface manager. |
| 142 virtual cc::SurfaceManager* GetSurfaceManager() = 0; | 142 virtual cc::SurfaceManager* GetSurfaceManager() = 0; |
| 143 | 143 |
| 144 // Inform the display corresponding to this compositor if it is visible. When | 144 // Inform the display corresponding to this compositor if it is visible. When |
| 145 // false it does not need to produce any frames. Visibility is reset for each | 145 // false it does not need to produce any frames. Visibility is reset for each |
| 146 // call to CreateCompositorFrameSink. | 146 // call to CreateCompositorFrameSink. |
| 147 virtual void SetDisplayVisible(ui::Compositor* compositor, bool visible) = 0; | 147 virtual void SetDisplayVisible(ui::Compositor* compositor, bool visible) = 0; |
| 148 | 148 |
| 149 // Resize the display corresponding to this compositor to a particular size. | 149 // Resize the display corresponding to this compositor to a particular size. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 class COMPOSITOR_EXPORT Compositor | 203 class COMPOSITOR_EXPORT Compositor |
| 204 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient), | 204 : NON_EXPORTED_BASE(public cc::LayerTreeHostClient), |
| 205 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { | 205 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { |
| 206 public: | 206 public: |
| 207 Compositor(ui::ContextFactory* context_factory, | 207 Compositor(ui::ContextFactory* context_factory, |
| 208 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 208 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 209 ~Compositor() override; | 209 ~Compositor() override; |
| 210 | 210 |
| 211 ui::ContextFactory* context_factory() { return context_factory_; } | 211 ui::ContextFactory* context_factory() { return context_factory_; } |
| 212 | 212 |
| 213 void AddSurfaceClient(uint32_t client_id); | 213 void AddFrameSink(const cc::FrameSinkId& frame_sink_id); |
| 214 void RemoveSurfaceClient(uint32_t client_id); | 214 void RemoveFrameSink(const cc::FrameSinkId& frame_sink_id); |
| 215 | 215 |
| 216 void SetCompositorFrameSink(std::unique_ptr<cc::CompositorFrameSink> surface); | 216 void SetCompositorFrameSink(std::unique_ptr<cc::CompositorFrameSink> surface); |
| 217 | 217 |
| 218 // Schedules a redraw of the layer tree associated with this compositor. | 218 // Schedules a redraw of the layer tree associated with this compositor. |
| 219 void ScheduleDraw(); | 219 void ScheduleDraw(); |
| 220 | 220 |
| 221 // Sets the root of the layer tree drawn by this Compositor. The root layer | 221 // Sets the root of the layer tree drawn by this Compositor. The root layer |
| 222 // must have no parent. The compositor's root layer is reset if the root layer | 222 // must have no parent. The compositor's root layer is reset if the root layer |
| 223 // is destroyed. NULL can be passed to reset the root layer, in which case the | 223 // is destroyed. NULL can be passed to reset the root layer, in which case the |
| 224 // compositor will stop drawing anything. | 224 // compositor will stop drawing anything. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 Layer* root_layer_; | 406 Layer* root_layer_; |
| 407 | 407 |
| 408 base::ObserverList<CompositorObserver, true> observer_list_; | 408 base::ObserverList<CompositorObserver, true> observer_list_; |
| 409 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; | 409 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; |
| 410 | 410 |
| 411 gfx::AcceleratedWidget widget_; | 411 gfx::AcceleratedWidget widget_; |
| 412 #if defined(USE_AURA) | 412 #if defined(USE_AURA) |
| 413 ui::Window* window_; | 413 ui::Window* window_; |
| 414 #endif | 414 #endif |
| 415 // A map from child id to parent id. | 415 // A map from child id to parent id. |
| 416 std::unordered_map<uint32_t, uint32_t> surface_clients_; | 416 std::unordered_map<cc::FrameSinkId, cc::FrameSinkId, cc::FrameSinkIdHash> |
| 417 frame_sinks_; |
| 417 bool widget_valid_; | 418 bool widget_valid_; |
| 418 bool compositor_frame_sink_requested_; | 419 bool compositor_frame_sink_requested_; |
| 419 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 420 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 420 scoped_refptr<cc::Layer> root_web_layer_; | 421 scoped_refptr<cc::Layer> root_web_layer_; |
| 421 std::unique_ptr<cc::LayerTreeHost> host_; | 422 std::unique_ptr<cc::LayerTreeHost> host_; |
| 422 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 423 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 423 | 424 |
| 424 // The manager of vsync parameters for this compositor. | 425 // The manager of vsync parameters for this compositor. |
| 425 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 426 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
| 426 | 427 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 437 gfx::ColorSpace color_space_; | 438 gfx::ColorSpace color_space_; |
| 438 | 439 |
| 439 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 440 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 440 | 441 |
| 441 DISALLOW_COPY_AND_ASSIGN(Compositor); | 442 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 442 }; | 443 }; |
| 443 | 444 |
| 444 } // namespace ui | 445 } // namespace ui |
| 445 | 446 |
| 446 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 447 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |