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 | |
229 // Returns the widget for this compositor. | 221 // Returns the widget for this compositor. |
230 gfx::AcceleratedWidget widget() const { return widget_; } | 222 gfx::AcceleratedWidget widget() const { return widget_; } |
231 | 223 |
| 224 // Returns the vsync manager for this compositor. |
| 225 scoped_refptr<CompositorVSyncManager> vsync_manager() const; |
| 226 |
232 // Returns the main thread task runner this compositor uses. Users of the | 227 // Returns the main thread task runner this compositor uses. Users of the |
233 // compositor generally shouldn't use this. | 228 // compositor generally shouldn't use this. |
234 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 229 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
235 return task_runner_; | 230 return task_runner_; |
236 } | 231 } |
237 | 232 |
238 // Compositor does not own observers. It is the responsibility of the | 233 // Compositor does not own observers. It is the responsibility of the |
239 // observer to remove itself when it is done observing. | 234 // observer to remove itself when it is done observing. |
240 void AddObserver(CompositorObserver* observer); | 235 void AddObserver(CompositorObserver* observer); |
241 void RemoveObserver(CompositorObserver* observer); | 236 void RemoveObserver(CompositorObserver* observer); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 ObserverList<CompositorObserver, true> observer_list_; | 328 ObserverList<CompositorObserver, true> observer_list_; |
334 ObserverList<CompositorAnimationObserver> animation_observer_list_; | 329 ObserverList<CompositorAnimationObserver> animation_observer_list_; |
335 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; | 330 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; |
336 | 331 |
337 gfx::AcceleratedWidget widget_; | 332 gfx::AcceleratedWidget widget_; |
338 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 333 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
339 scoped_refptr<cc::Layer> root_web_layer_; | 334 scoped_refptr<cc::Layer> root_web_layer_; |
340 scoped_ptr<cc::LayerTreeHost> host_; | 335 scoped_ptr<cc::LayerTreeHost> host_; |
341 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 336 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
342 | 337 |
| 338 // The manager of vsync parameters for this compositor. |
| 339 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
| 340 |
343 // The device scale factor of the monitor that this compositor is compositing | 341 // The device scale factor of the monitor that this compositor is compositing |
344 // layers on. | 342 // layers on. |
345 float device_scale_factor_; | 343 float device_scale_factor_; |
346 | 344 |
347 int last_started_frame_; | 345 int last_started_frame_; |
348 int last_ended_frame_; | 346 int last_ended_frame_; |
349 | 347 |
350 bool locks_will_time_out_; | 348 bool locks_will_time_out_; |
351 CompositorLock* compositor_lock_; | 349 CompositorLock* compositor_lock_; |
352 | 350 |
353 LayerAnimatorCollection layer_animator_collection_; | 351 LayerAnimatorCollection layer_animator_collection_; |
354 | 352 |
355 // Used to send to any new CompositorBeginFrameObserver immediately. | 353 // Used to send to any new CompositorBeginFrameObserver immediately. |
356 cc::BeginFrameArgs missed_begin_frame_args_; | 354 cc::BeginFrameArgs missed_begin_frame_args_; |
357 | 355 |
358 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 356 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
359 | 357 |
360 DISALLOW_COPY_AND_ASSIGN(Compositor); | 358 DISALLOW_COPY_AND_ASSIGN(Compositor); |
361 }; | 359 }; |
362 | 360 |
363 } // namespace ui | 361 } // namespace ui |
364 | 362 |
365 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 363 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |