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