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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 // The "authoritative" vsync interval, if provided, will override interval | 224 // The "authoritative" vsync interval, if provided, will override interval |
225 // reported from 3D context. This is typically the value reported by a more | 225 // reported from 3D context. This is typically the value reported by a more |
226 // reliable source, e.g, the platform display configuration. | 226 // reliable source, e.g, the platform display configuration. |
227 // In the particular case of ChromeOS -- this is the value queried through | 227 // In the particular case of ChromeOS -- this is the value queried through |
228 // XRandR, which is more reliable than the value queried through the 3D | 228 // XRandR, which is more reliable than the value queried through the 3D |
229 // context. | 229 // context. |
230 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); | 230 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
231 | 231 |
232 // Sets the widget for the compositor to render into. | 232 // Sets the widget for the compositor to render into. |
233 void SetAcceleratedWidgetAndStartCompositor(gfx::AcceleratedWidget widget); | 233 void SetAcceleratedWidget(gfx::AcceleratedWidget widget); |
234 gfx::AcceleratedWidget widget() const { return widget_; } | 234 gfx::AcceleratedWidget widget() const; |
235 | 235 |
236 // Returns the vsync manager for this compositor. | 236 // Returns the vsync manager for this compositor. |
237 scoped_refptr<CompositorVSyncManager> vsync_manager() const; | 237 scoped_refptr<CompositorVSyncManager> vsync_manager() const; |
238 | 238 |
239 // Returns the main thread task runner this compositor uses. Users of the | 239 // Returns the main thread task runner this compositor uses. Users of the |
240 // compositor generally shouldn't use this. | 240 // compositor generally shouldn't use this. |
241 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 241 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
242 return task_runner_; | 242 return task_runner_; |
243 } | 243 } |
244 | 244 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 ui::ContextFactory* context_factory_; | 336 ui::ContextFactory* context_factory_; |
337 | 337 |
338 // The root of the Layer tree drawn by this compositor. | 338 // The root of the Layer tree drawn by this compositor. |
339 Layer* root_layer_; | 339 Layer* root_layer_; |
340 | 340 |
341 base::ObserverList<CompositorObserver, true> observer_list_; | 341 base::ObserverList<CompositorObserver, true> observer_list_; |
342 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; | 342 base::ObserverList<CompositorAnimationObserver> animation_observer_list_; |
343 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; | 343 std::list<CompositorBeginFrameObserver*> begin_frame_observer_list_; |
344 | 344 |
345 gfx::AcceleratedWidget widget_; | 345 gfx::AcceleratedWidget widget_; |
| 346 bool widget_valid_; |
| 347 bool output_surface_requested_; |
346 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 348 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; |
347 scoped_refptr<cc::Layer> root_web_layer_; | 349 scoped_refptr<cc::Layer> root_web_layer_; |
348 scoped_ptr<cc::LayerTreeHost> host_; | 350 scoped_ptr<cc::LayerTreeHost> host_; |
349 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 351 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
350 | 352 |
351 // The manager of vsync parameters for this compositor. | 353 // The manager of vsync parameters for this compositor. |
352 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 354 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
353 | 355 |
354 // The device scale factor of the monitor that this compositor is compositing | 356 // The device scale factor of the monitor that this compositor is compositing |
355 // layers on. | 357 // layers on. |
(...skipping 11 matching lines...) Expand all Loading... |
367 cc::BeginFrameArgs missed_begin_frame_args_; | 369 cc::BeginFrameArgs missed_begin_frame_args_; |
368 | 370 |
369 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 371 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
370 | 372 |
371 DISALLOW_COPY_AND_ASSIGN(Compositor); | 373 DISALLOW_COPY_AND_ASSIGN(Compositor); |
372 }; | 374 }; |
373 | 375 |
374 } // namespace ui | 376 } // namespace ui |
375 | 377 |
376 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 378 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |