| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "cc/output/begin_frame_args.h" | 19 #include "cc/output/begin_frame_args.h" |
| 20 #include "cc/surfaces/surface_sequence.h" | 20 #include "cc/surfaces/surface_sequence.h" |
| 21 #include "cc/trees/layer_tree_host_client.h" | 21 #include "cc/trees/layer_tree_host_client.h" |
| 22 #include "cc/trees/layer_tree_host_single_thread_client.h" | 22 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 23 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
| 24 #include "ui/compositor/compositor_animation_observer.h" | 24 #include "ui/compositor/compositor_animation_observer.h" |
| 25 #include "ui/compositor/compositor_export.h" | 25 #include "ui/compositor/compositor_export.h" |
| 26 #include "ui/compositor/compositor_observer.h" | 26 #include "ui/compositor/compositor_observer.h" |
| 27 #include "ui/compositor/layer_animator_collection.h" | 27 #include "ui/compositor/layer_animator_collection.h" |
| 28 #include "ui/gfx/color_profile.h" |
| 28 #include "ui/gfx/geometry/size.h" | 29 #include "ui/gfx/geometry/size.h" |
| 29 #include "ui/gfx/geometry/vector2d.h" | 30 #include "ui/gfx/geometry/vector2d.h" |
| 30 #include "ui/gfx/gpu_memory_buffer.h" | 31 #include "ui/gfx/gpu_memory_buffer.h" |
| 31 #include "ui/gfx/native_widget_types.h" | 32 #include "ui/gfx/native_widget_types.h" |
| 32 | 33 |
| 33 namespace base { | 34 namespace base { |
| 34 class RunLoop; | 35 class RunLoop; |
| 35 class SingleThreadTaskRunner; | 36 class SingleThreadTaskRunner; |
| 36 } | 37 } |
| 37 | 38 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 virtual std::unique_ptr<cc::SurfaceIdAllocator> | 132 virtual std::unique_ptr<cc::SurfaceIdAllocator> |
| 132 CreateSurfaceIdAllocator() = 0; | 133 CreateSurfaceIdAllocator() = 0; |
| 133 | 134 |
| 134 // Gets the surface manager. | 135 // Gets the surface manager. |
| 135 virtual cc::SurfaceManager* GetSurfaceManager() = 0; | 136 virtual cc::SurfaceManager* GetSurfaceManager() = 0; |
| 136 | 137 |
| 137 // Resize the display corresponding to this compositor to a particular size. | 138 // Resize the display corresponding to this compositor to a particular size. |
| 138 virtual void ResizeDisplay(ui::Compositor* compositor, | 139 virtual void ResizeDisplay(ui::Compositor* compositor, |
| 139 const gfx::Size& size) = 0; | 140 const gfx::Size& size) = 0; |
| 140 | 141 |
| 142 // Set the output color profile into which this compositor should render. |
| 143 virtual void SetDisplayColorProfile( |
| 144 ui::Compositor* compositor, |
| 145 const gfx::ColorProfile& color_profile) = 0; |
| 146 |
| 141 virtual void SetAuthoritativeVSyncInterval(ui::Compositor* compositor, | 147 virtual void SetAuthoritativeVSyncInterval(ui::Compositor* compositor, |
| 142 base::TimeDelta interval) = 0; | 148 base::TimeDelta interval) = 0; |
| 143 | 149 |
| 144 virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0; | 150 virtual void SetOutputIsSecure(Compositor* compositor, bool secure) = 0; |
| 145 | 151 |
| 146 virtual void AddObserver(ContextFactoryObserver* observer) = 0; | 152 virtual void AddObserver(ContextFactoryObserver* observer) = 0; |
| 147 | 153 |
| 148 virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; | 154 virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; |
| 149 }; | 155 }; |
| 150 | 156 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 234 |
| 229 // Finishes all outstanding rendering and disables swapping on this surface | 235 // Finishes all outstanding rendering and disables swapping on this surface |
| 230 // until it is resized. | 236 // until it is resized. |
| 231 void DisableSwapUntilResize(); | 237 void DisableSwapUntilResize(); |
| 232 | 238 |
| 233 void SetLatencyInfo(const LatencyInfo& latency_info); | 239 void SetLatencyInfo(const LatencyInfo& latency_info); |
| 234 | 240 |
| 235 // Sets the compositor's device scale factor and size. | 241 // Sets the compositor's device scale factor and size. |
| 236 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); | 242 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); |
| 237 | 243 |
| 244 // Set the output color profile into which this compositor should render. |
| 245 void SetDisplayColorProfile(const gfx::ColorProfile& color_profile); |
| 246 |
| 238 // Returns the size of the widget that is being drawn to in pixel coordinates. | 247 // Returns the size of the widget that is being drawn to in pixel coordinates. |
| 239 const gfx::Size& size() const { return size_; } | 248 const gfx::Size& size() const { return size_; } |
| 240 | 249 |
| 241 // Sets the background color used for areas that aren't covered by | 250 // Sets the background color used for areas that aren't covered by |
| 242 // the |root_layer|. | 251 // the |root_layer|. |
| 243 void SetBackgroundColor(SkColor color); | 252 void SetBackgroundColor(SkColor color); |
| 244 | 253 |
| 245 // Sets the visibility of the underlying compositor. | 254 // Sets the visibility of the underlying compositor. |
| 246 void SetVisible(bool visible); | 255 void SetVisible(bool visible); |
| 247 | 256 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 scoped_refptr<cc::AnimationTimeline> animation_timeline_; | 397 scoped_refptr<cc::AnimationTimeline> animation_timeline_; |
| 389 | 398 |
| 390 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 399 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 391 | 400 |
| 392 DISALLOW_COPY_AND_ASSIGN(Compositor); | 401 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 393 }; | 402 }; |
| 394 | 403 |
| 395 } // namespace ui | 404 } // namespace ui |
| 396 | 405 |
| 397 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 406 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |