| 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 <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Sets the background color used for areas that aren't covered by | 211 // Sets the background color used for areas that aren't covered by |
| 212 // the |root_layer|. | 212 // the |root_layer|. |
| 213 void SetBackgroundColor(SkColor color); | 213 void SetBackgroundColor(SkColor color); |
| 214 | 214 |
| 215 // Sets the visibility of the underlying compositor. | 215 // Sets the visibility of the underlying compositor. |
| 216 void SetVisible(bool visible); | 216 void SetVisible(bool visible); |
| 217 | 217 |
| 218 // Gets the visibility of the underlying compositor. | 218 // Gets the visibility of the underlying compositor. |
| 219 bool IsVisible(); | 219 bool IsVisible(); |
| 220 | 220 |
| 221 // The "authoritative" vsync interval, if provided, will override interval |
| 222 // reported from 3D context. This is typically the value reported by a more |
| 223 // reliable source, e.g, the platform display configuration. |
| 224 // In the particular case of ChromeOS -- this is the value queried through |
| 225 // XRandR, which is more reliable than the value queried through the 3D |
| 226 // context. |
| 227 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
| 228 |
| 221 // Returns the widget for this compositor. | 229 // Returns the widget for this compositor. |
| 222 gfx::AcceleratedWidget widget() const { return widget_; } | 230 gfx::AcceleratedWidget widget() const { return widget_; } |
| 223 | 231 |
| 224 // Returns the vsync manager for this compositor. | |
| 225 scoped_refptr<CompositorVSyncManager> vsync_manager() const; | |
| 226 | |
| 227 // Returns the main thread task runner this compositor uses. Users of the | 232 // Returns the main thread task runner this compositor uses. Users of the |
| 228 // compositor generally shouldn't use this. | 233 // compositor generally shouldn't use this. |
| 229 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 234 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
| 230 return task_runner_; | 235 return task_runner_; |
| 231 } | 236 } |
| 232 | 237 |
| 233 // Compositor does not own observers. It is the responsibility of the | 238 // Compositor does not own observers. It is the responsibility of the |
| 234 // observer to remove itself when it is done observing. | 239 // observer to remove itself when it is done observing. |
| 235 void AddObserver(CompositorObserver* observer); | 240 void AddObserver(CompositorObserver* observer); |
| 236 void RemoveObserver(CompositorObserver* observer); | 241 void RemoveObserver(CompositorObserver* observer); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 ObserverList<CompositorObserver, true> observer_list_; | 333 ObserverList<CompositorObserver, true> observer_list_; |
| 329 ObserverList<CompositorAnimationObserver> animation_observer_list_; | 334 ObserverList<CompositorAnimationObserver> animation_observer_list_; |
| 330 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; | 335 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; |
| 331 | 336 |
| 332 gfx::AcceleratedWidget widget_; | 337 gfx::AcceleratedWidget widget_; |
| 333 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 338 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
| 334 scoped_refptr<cc::Layer> root_web_layer_; | 339 scoped_refptr<cc::Layer> root_web_layer_; |
| 335 scoped_ptr<cc::LayerTreeHost> host_; | 340 scoped_ptr<cc::LayerTreeHost> host_; |
| 336 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 341 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 337 | 342 |
| 338 // The manager of vsync parameters for this compositor. | |
| 339 scoped_refptr<CompositorVSyncManager> vsync_manager_; | |
| 340 | |
| 341 // The device scale factor of the monitor that this compositor is compositing | 343 // The device scale factor of the monitor that this compositor is compositing |
| 342 // layers on. | 344 // layers on. |
| 343 float device_scale_factor_; | 345 float device_scale_factor_; |
| 344 | 346 |
| 345 int last_started_frame_; | 347 int last_started_frame_; |
| 346 int last_ended_frame_; | 348 int last_ended_frame_; |
| 347 | 349 |
| 348 bool locks_will_time_out_; | 350 bool locks_will_time_out_; |
| 349 CompositorLock* compositor_lock_; | 351 CompositorLock* compositor_lock_; |
| 350 | 352 |
| 351 LayerAnimatorCollection layer_animator_collection_; | 353 LayerAnimatorCollection layer_animator_collection_; |
| 352 | 354 |
| 353 // Used to send to any new CompositorBeginFrameObserver immediately. | 355 // Used to send to any new CompositorBeginFrameObserver immediately. |
| 354 cc::BeginFrameArgs missed_begin_frame_args_; | 356 cc::BeginFrameArgs missed_begin_frame_args_; |
| 355 | 357 |
| 356 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 358 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 357 | 359 |
| 358 DISALLOW_COPY_AND_ASSIGN(Compositor); | 360 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 359 }; | 361 }; |
| 360 | 362 |
| 361 } // namespace ui | 363 } // namespace ui |
| 362 | 364 |
| 363 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 365 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |