| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 // Where possible, draws are scissored to a damage region calculated from | 176 // Where possible, draws are scissored to a damage region calculated from |
| 177 // changes to layer properties. This bypasses that and indicates that | 177 // changes to layer properties. This bypasses that and indicates that |
| 178 // the whole frame needs to be drawn. | 178 // the whole frame needs to be drawn. |
| 179 void ScheduleFullRedraw(); | 179 void ScheduleFullRedraw(); |
| 180 | 180 |
| 181 // Schedule redraw and append damage_rect to the damage region calculated | 181 // Schedule redraw and append damage_rect to the damage region calculated |
| 182 // from changes to layer properties. | 182 // from changes to layer properties. |
| 183 void ScheduleRedrawRect(const gfx::Rect& damage_rect); | 183 void ScheduleRedrawRect(const gfx::Rect& damage_rect); |
| 184 | 184 |
| 185 // Finishes all outstanding rendering and disables swapping on this surface. |
| 186 void FinishAllRendering(); |
| 187 |
| 185 // Finishes all outstanding rendering and disables swapping on this surface | 188 // Finishes all outstanding rendering and disables swapping on this surface |
| 186 // until it is resized. | 189 // until it is resized. |
| 187 void DisableSwapUntilResize(); | 190 void DisableSwapUntilResize(); |
| 188 | 191 |
| 189 void SetLatencyInfo(const LatencyInfo& latency_info); | 192 void SetLatencyInfo(const LatencyInfo& latency_info); |
| 190 | 193 |
| 191 // Sets the compositor's device scale factor and size. | 194 // Sets the compositor's device scale factor and size. |
| 192 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); | 195 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); |
| 193 | 196 |
| 194 // Returns the size of the widget that is being drawn to in pixel coordinates. | 197 // Returns the size of the widget that is being drawn to in pixel coordinates. |
| 195 const gfx::Size& size() const { return size_; } | 198 const gfx::Size& size() const { return size_; } |
| 196 | 199 |
| 197 // Sets the background color used for areas that aren't covered by | 200 // Sets the background color used for areas that aren't covered by |
| 198 // the |root_layer|. | 201 // the |root_layer|. |
| 199 void SetBackgroundColor(SkColor color); | 202 void SetBackgroundColor(SkColor color); |
| 200 | 203 |
| 201 // Set the visibility of the underlying compositor. | 204 // Sets the visibility of the underlying compositor. |
| 202 void SetVisible(bool visible); | 205 void SetVisible(bool visible); |
| 203 | 206 |
| 207 // Gets the visibility of the underlying compositor. |
| 208 bool IsVisible(); |
| 209 |
| 204 // Returns the widget for this compositor. | 210 // Returns the widget for this compositor. |
| 205 gfx::AcceleratedWidget widget() const { return widget_; } | 211 gfx::AcceleratedWidget widget() const { return widget_; } |
| 206 | 212 |
| 207 // Returns the vsync manager for this compositor. | 213 // Returns the vsync manager for this compositor. |
| 208 scoped_refptr<CompositorVSyncManager> vsync_manager() const; | 214 scoped_refptr<CompositorVSyncManager> vsync_manager() const; |
| 209 | 215 |
| 210 // Returns the main thread task runner this compositor uses. Users of the | 216 // Returns the main thread task runner this compositor uses. Users of the |
| 211 // compositor generally shouldn't use this. | 217 // compositor generally shouldn't use this. |
| 212 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { | 218 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const { |
| 213 return task_runner_; | 219 return task_runner_; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 LayerAnimatorCollection layer_animator_collection_; | 337 LayerAnimatorCollection layer_animator_collection_; |
| 332 | 338 |
| 333 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 339 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 334 | 340 |
| 335 DISALLOW_COPY_AND_ASSIGN(Compositor); | 341 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 336 }; | 342 }; |
| 337 | 343 |
| 338 } // namespace ui | 344 } // namespace ui |
| 339 | 345 |
| 340 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 346 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |