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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // When true, the factory uses test contexts that do not do real GL | 90 // When true, the factory uses test contexts that do not do real GL |
91 // operations. | 91 // operations. |
92 virtual bool DoesCreateTestContexts() = 0; | 92 virtual bool DoesCreateTestContexts() = 0; |
93 | 93 |
94 // Gets the shared bitmap manager for software mode. | 94 // Gets the shared bitmap manager for software mode. |
95 virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; | 95 virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0; |
96 | 96 |
97 // Gets the GPU memory buffer manager. | 97 // Gets the GPU memory buffer manager. |
98 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; | 98 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; |
99 | 99 |
100 // Gets the compositor message loop, or NULL if not using threaded | |
101 // compositing. | |
102 virtual base::MessageLoopProxy* GetCompositorMessageLoop() = 0; | |
103 | |
104 // Creates a Surface ID allocator with a new namespace. | 100 // Creates a Surface ID allocator with a new namespace. |
105 virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0; | 101 virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0; |
106 | 102 |
107 // Resize the display corresponding to this compositor to a particular size. | 103 // Resize the display corresponding to this compositor to a particular size. |
108 virtual void ResizeDisplay(ui::Compositor* compositor, | 104 virtual void ResizeDisplay(ui::Compositor* compositor, |
109 const gfx::Size& size) = 0; | 105 const gfx::Size& size) = 0; |
110 }; | 106 }; |
111 | 107 |
112 // This class represents a lock on the compositor, that can be used to prevent | 108 // This class represents a lock on the compositor, that can be used to prevent |
113 // commits to the compositor tree while we're waiting for an asynchronous | 109 // commits to the compositor tree while we're waiting for an asynchronous |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // The root of the Layer tree drawn by this compositor. | 304 // The root of the Layer tree drawn by this compositor. |
309 Layer* root_layer_; | 305 Layer* root_layer_; |
310 | 306 |
311 ObserverList<CompositorObserver, true> observer_list_; | 307 ObserverList<CompositorObserver, true> observer_list_; |
312 ObserverList<CompositorAnimationObserver> animation_observer_list_; | 308 ObserverList<CompositorAnimationObserver> animation_observer_list_; |
313 | 309 |
314 gfx::AcceleratedWidget widget_; | 310 gfx::AcceleratedWidget widget_; |
315 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 311 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
316 scoped_refptr<cc::Layer> root_web_layer_; | 312 scoped_refptr<cc::Layer> root_web_layer_; |
317 scoped_ptr<cc::LayerTreeHost> host_; | 313 scoped_ptr<cc::LayerTreeHost> host_; |
318 scoped_refptr<base::MessageLoopProxy> compositor_thread_loop_; | |
319 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 314 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
320 | 315 |
321 // The manager of vsync parameters for this compositor. | 316 // The manager of vsync parameters for this compositor. |
322 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 317 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
323 | 318 |
324 // The device scale factor of the monitor that this compositor is compositing | 319 // The device scale factor of the monitor that this compositor is compositing |
325 // layers on. | 320 // layers on. |
326 float device_scale_factor_; | 321 float device_scale_factor_; |
327 | 322 |
328 int last_started_frame_; | 323 int last_started_frame_; |
329 int last_ended_frame_; | 324 int last_ended_frame_; |
330 | 325 |
331 int num_failed_recreate_attempts_; | 326 int num_failed_recreate_attempts_; |
332 | 327 |
333 bool disable_schedule_composite_; | 328 bool disable_schedule_composite_; |
334 | 329 |
335 CompositorLock* compositor_lock_; | 330 CompositorLock* compositor_lock_; |
336 | 331 |
337 LayerAnimatorCollection layer_animator_collection_; | 332 LayerAnimatorCollection layer_animator_collection_; |
338 | 333 |
339 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 334 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
340 | 335 |
341 DISALLOW_COPY_AND_ASSIGN(Compositor); | 336 DISALLOW_COPY_AND_ASSIGN(Compositor); |
342 }; | 337 }; |
343 | 338 |
344 } // namespace ui | 339 } // namespace ui |
345 | 340 |
346 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 341 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |