| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 bool IsLocked() { return compositor_lock_ != NULL; } | 269 bool IsLocked() { return compositor_lock_ != NULL; } |
| 270 | 270 |
| 271 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; | 271 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; |
| 272 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); | 272 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); |
| 273 | 273 |
| 274 LayerAnimatorCollection* layer_animator_collection() { | 274 LayerAnimatorCollection* layer_animator_collection() { |
| 275 return &layer_animator_collection_; | 275 return &layer_animator_collection_; |
| 276 } | 276 } |
| 277 | 277 |
| 278 // Inserts a SurfaceSequence that will be satisfied on the next frame this | |
| 279 // compositor commits and swaps. | |
| 280 cc::SurfaceSequence InsertSurfaceSequenceForNextFrame(); | |
| 281 | |
| 282 cc::SurfaceIdAllocator* surface_id_allocator() { | 278 cc::SurfaceIdAllocator* surface_id_allocator() { |
| 283 return surface_id_allocator_.get(); | 279 return surface_id_allocator_.get(); |
| 284 } | 280 } |
| 285 | 281 |
| 286 private: | 282 private: |
| 287 friend class base::RefCounted<Compositor>; | 283 friend class base::RefCounted<Compositor>; |
| 288 friend class CompositorLock; | 284 friend class CompositorLock; |
| 289 | 285 |
| 290 // Called by CompositorLock. | 286 // Called by CompositorLock. |
| 291 void UnlockCompositor(); | 287 void UnlockCompositor(); |
| 292 | 288 |
| 293 // Called to release any pending CompositorLock | 289 // Called to release any pending CompositorLock |
| 294 void CancelCompositorLock(); | 290 void CancelCompositorLock(); |
| 295 | 291 |
| 296 // Notifies the compositor that compositing is complete. | 292 // Notifies the compositor that compositing is complete. |
| 297 void NotifyEnd(); | 293 void NotifyEnd(); |
| 298 | 294 |
| 299 gfx::Size size_; | 295 gfx::Size size_; |
| 300 | 296 |
| 301 ui::ContextFactory* context_factory_; | 297 ui::ContextFactory* context_factory_; |
| 302 | 298 |
| 303 // The root of the Layer tree drawn by this compositor. | 299 // The root of the Layer tree drawn by this compositor. |
| 304 Layer* root_layer_; | 300 Layer* root_layer_; |
| 305 | 301 |
| 306 ObserverList<CompositorObserver> observer_list_; | 302 ObserverList<CompositorObserver> observer_list_; |
| 307 ObserverList<CompositorAnimationObserver> animation_observer_list_; | 303 ObserverList<CompositorAnimationObserver> animation_observer_list_; |
| 308 | 304 |
| 309 gfx::AcceleratedWidget widget_; | 305 gfx::AcceleratedWidget widget_; |
| 310 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 306 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 311 uint32_t surface_sequence_number_; | |
| 312 scoped_refptr<cc::Layer> root_web_layer_; | 307 scoped_refptr<cc::Layer> root_web_layer_; |
| 313 scoped_ptr<cc::LayerTreeHost> host_; | 308 scoped_ptr<cc::LayerTreeHost> host_; |
| 314 scoped_refptr<base::MessageLoopProxy> compositor_thread_loop_; | 309 scoped_refptr<base::MessageLoopProxy> compositor_thread_loop_; |
| 315 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 310 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 316 | 311 |
| 317 // The manager of vsync parameters for this compositor. | 312 // The manager of vsync parameters for this compositor. |
| 318 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 313 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
| 319 | 314 |
| 320 // The device scale factor of the monitor that this compositor is compositing | 315 // The device scale factor of the monitor that this compositor is compositing |
| 321 // layers on. | 316 // layers on. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 340 LayerAnimatorCollection layer_animator_collection_; | 335 LayerAnimatorCollection layer_animator_collection_; |
| 341 | 336 |
| 342 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 337 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 343 | 338 |
| 344 DISALLOW_COPY_AND_ASSIGN(Compositor); | 339 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 345 }; | 340 }; |
| 346 | 341 |
| 347 } // namespace ui | 342 } // namespace ui |
| 348 | 343 |
| 349 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 344 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |