| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { | 204 NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) { |
| 205 public: | 205 public: |
| 206 Compositor(ui::ContextFactory* context_factory, | 206 Compositor(ui::ContextFactory* context_factory, |
| 207 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 207 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 208 ~Compositor() override; | 208 ~Compositor() override; |
| 209 | 209 |
| 210 ui::ContextFactory* context_factory() { return context_factory_; } | 210 ui::ContextFactory* context_factory() { return context_factory_; } |
| 211 | 211 |
| 212 void AddSurfaceClient(uint32_t client_id); | 212 void AddSurfaceClient(uint32_t client_id); |
| 213 void RemoveSurfaceClient(uint32_t client_id); | 213 void RemoveSurfaceClient(uint32_t client_id); |
| 214 const std::unordered_map<uint32_t, uint32_t>& SurfaceClientsForTesting() { | |
| 215 return surface_clients_; | |
| 216 } | |
| 217 | 214 |
| 218 void SetOutputSurface(std::unique_ptr<cc::OutputSurface> surface); | 215 void SetOutputSurface(std::unique_ptr<cc::OutputSurface> surface); |
| 219 | 216 |
| 220 // Schedules a redraw of the layer tree associated with this compositor. | 217 // Schedules a redraw of the layer tree associated with this compositor. |
| 221 void ScheduleDraw(); | 218 void ScheduleDraw(); |
| 222 | 219 |
| 223 // Sets the root of the layer tree drawn by this Compositor. The root layer | 220 // Sets the root of the layer tree drawn by this Compositor. The root layer |
| 224 // must have no parent. The compositor's root layer is reset if the root layer | 221 // must have no parent. The compositor's root layer is reset if the root layer |
| 225 // is destroyed. NULL can be passed to reset the root layer, in which case the | 222 // is destroyed. NULL can be passed to reset the root layer, in which case the |
| 226 // compositor will stop drawing anything. | 223 // compositor will stop drawing anything. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // The root of the Layer tree drawn by this compositor. | 403 // The root of the Layer tree drawn by this compositor. |
| 407 Layer* root_layer_; | 404 Layer* root_layer_; |
| 408 | 405 |
| 409 base::ObserverList<CompositorObserver, true> observer_list_; | 406 base::ObserverList<CompositorObserver, true> observer_list_; |
| 410 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; | 407 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; |
| 411 | 408 |
| 412 gfx::AcceleratedWidget widget_; | 409 gfx::AcceleratedWidget widget_; |
| 413 #if defined(USE_AURA) | 410 #if defined(USE_AURA) |
| 414 ui::Window* window_; | 411 ui::Window* window_; |
| 415 #endif | 412 #endif |
| 413 // A map from child id to parent id. |
| 416 std::unordered_map<uint32_t, uint32_t> surface_clients_; | 414 std::unordered_map<uint32_t, uint32_t> surface_clients_; |
| 417 bool widget_valid_; | 415 bool widget_valid_; |
| 418 bool output_surface_requested_; | 416 bool output_surface_requested_; |
| 419 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 417 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 420 scoped_refptr<cc::Layer> root_web_layer_; | 418 scoped_refptr<cc::Layer> root_web_layer_; |
| 421 std::unique_ptr<cc::LayerTreeHost> host_; | 419 std::unique_ptr<cc::LayerTreeHost> host_; |
| 422 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 420 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 423 | 421 |
| 424 // The manager of vsync parameters for this compositor. | 422 // The manager of vsync parameters for this compositor. |
| 425 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 423 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
| 426 | 424 |
| 427 // The device scale factor of the monitor that this compositor is compositing | 425 // The device scale factor of the monitor that this compositor is compositing |
| 428 // layers on. | 426 // layers on. |
| 429 float device_scale_factor_; | 427 float device_scale_factor_; |
| 430 | 428 |
| 431 bool locks_will_time_out_; | 429 bool locks_will_time_out_; |
| 432 CompositorLock* compositor_lock_; | 430 CompositorLock* compositor_lock_; |
| 433 | 431 |
| 434 LayerAnimatorCollection layer_animator_collection_; | 432 LayerAnimatorCollection layer_animator_collection_; |
| 435 scoped_refptr<cc::AnimationTimeline> animation_timeline_; | 433 scoped_refptr<cc::AnimationTimeline> animation_timeline_; |
| 436 | 434 |
| 437 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 435 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 438 | 436 |
| 439 DISALLOW_COPY_AND_ASSIGN(Compositor); | 437 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 440 }; | 438 }; |
| 441 | 439 |
| 442 } // namespace ui | 440 } // namespace ui |
| 443 | 441 |
| 444 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 442 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |