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