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 15 matching lines...) Expand all Loading... |
26 #include "ui/gfx/geometry/size.h" | 26 #include "ui/gfx/geometry/size.h" |
27 #include "ui/gfx/geometry/vector2d.h" | 27 #include "ui/gfx/geometry/vector2d.h" |
28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
29 | 29 |
30 namespace base { | 30 namespace base { |
31 class MessageLoopProxy; | 31 class MessageLoopProxy; |
32 class RunLoop; | 32 class RunLoop; |
33 } | 33 } |
34 | 34 |
35 namespace cc { | 35 namespace cc { |
| 36 class AnimationTimeline; |
36 class ContextProvider; | 37 class ContextProvider; |
37 class Layer; | 38 class Layer; |
38 class LayerTreeDebugState; | 39 class LayerTreeDebugState; |
39 class LayerTreeHost; | 40 class LayerTreeHost; |
40 class RendererSettings; | 41 class RendererSettings; |
41 class SharedBitmapManager; | 42 class SharedBitmapManager; |
42 class SurfaceIdAllocator; | 43 class SurfaceIdAllocator; |
43 class TaskGraphRunner; | 44 class TaskGraphRunner; |
44 } | 45 } |
45 | 46 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 // Sets the root of the layer tree drawn by this Compositor. The root layer | 170 // Sets the root of the layer tree drawn by this Compositor. The root layer |
170 // must have no parent. The compositor's root layer is reset if the root layer | 171 // must have no parent. The compositor's root layer is reset if the root layer |
171 // is destroyed. NULL can be passed to reset the root layer, in which case the | 172 // is destroyed. NULL can be passed to reset the root layer, in which case the |
172 // compositor will stop drawing anything. | 173 // compositor will stop drawing anything. |
173 // The Compositor does not own the root layer. | 174 // The Compositor does not own the root layer. |
174 const Layer* root_layer() const { return root_layer_; } | 175 const Layer* root_layer() const { return root_layer_; } |
175 Layer* root_layer() { return root_layer_; } | 176 Layer* root_layer() { return root_layer_; } |
176 void SetRootLayer(Layer* root_layer); | 177 void SetRootLayer(Layer* root_layer); |
177 | 178 |
| 179 cc::AnimationTimeline* GetAnimationTimeline() const; |
| 180 |
178 // Called when we need the compositor to preserve the alpha channel in the | 181 // Called when we need the compositor to preserve the alpha channel in the |
179 // output for situations when we want to render transparently atop something | 182 // output for situations when we want to render transparently atop something |
180 // else, e.g. Aero glass. | 183 // else, e.g. Aero glass. |
181 void SetHostHasTransparentBackground(bool host_has_transparent_background); | 184 void SetHostHasTransparentBackground(bool host_has_transparent_background); |
182 | 185 |
183 // The scale factor of the device that this compositor is | 186 // The scale factor of the device that this compositor is |
184 // compositing layers on. | 187 // compositing layers on. |
185 float device_scale_factor() const { return device_scale_factor_; } | 188 float device_scale_factor() const { return device_scale_factor_; } |
186 | 189 |
187 // Where possible, draws are scissored to a damage region calculated from | 190 // Where possible, draws are scissored to a damage region calculated from |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 295 |
293 // cc::LayerTreeHostSingleThreadClient implementation. | 296 // cc::LayerTreeHostSingleThreadClient implementation. |
294 void DidPostSwapBuffers() override; | 297 void DidPostSwapBuffers() override; |
295 void DidAbortSwapBuffers() override; | 298 void DidAbortSwapBuffers() override; |
296 | 299 |
297 bool IsLocked() { return compositor_lock_ != NULL; } | 300 bool IsLocked() { return compositor_lock_ != NULL; } |
298 | 301 |
299 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; | 302 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; |
300 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); | 303 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); |
301 const cc::RendererSettings& GetRendererSettings() const; | 304 const cc::RendererSettings& GetRendererSettings() const; |
| 305 const cc::LayerTreeHost& GetLayerTreeHost() const; |
302 | 306 |
303 LayerAnimatorCollection* layer_animator_collection() { | 307 LayerAnimatorCollection* layer_animator_collection() { |
304 return &layer_animator_collection_; | 308 return &layer_animator_collection_; |
305 } | 309 } |
306 | 310 |
307 cc::SurfaceIdAllocator* surface_id_allocator() { | 311 cc::SurfaceIdAllocator* surface_id_allocator() { |
308 return surface_id_allocator_.get(); | 312 return surface_id_allocator_.get(); |
309 } | 313 } |
310 | 314 |
311 private: | 315 private: |
(...skipping 30 matching lines...) Expand all Loading... |
342 // layers on. | 346 // layers on. |
343 float device_scale_factor_; | 347 float device_scale_factor_; |
344 | 348 |
345 int last_started_frame_; | 349 int last_started_frame_; |
346 int last_ended_frame_; | 350 int last_ended_frame_; |
347 | 351 |
348 bool locks_will_time_out_; | 352 bool locks_will_time_out_; |
349 CompositorLock* compositor_lock_; | 353 CompositorLock* compositor_lock_; |
350 | 354 |
351 LayerAnimatorCollection layer_animator_collection_; | 355 LayerAnimatorCollection layer_animator_collection_; |
| 356 scoped_refptr<cc::AnimationTimeline> animation_timeline_; |
352 | 357 |
353 // Used to send to any new CompositorBeginFrameObserver immediately. | 358 // Used to send to any new CompositorBeginFrameObserver immediately. |
354 cc::BeginFrameArgs missed_begin_frame_args_; | 359 cc::BeginFrameArgs missed_begin_frame_args_; |
355 | 360 |
356 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 361 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
357 | 362 |
358 DISALLOW_COPY_AND_ASSIGN(Compositor); | 363 DISALLOW_COPY_AND_ASSIGN(Compositor); |
359 }; | 364 }; |
360 | 365 |
361 } // namespace ui | 366 } // namespace ui |
362 | 367 |
363 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 368 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |