Chromium Code Reviews| 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 // Set the visibility of the underlying compositor. |
| 202 void SetVisible(bool visible); | 205 void SetVisible(bool visible); |
| 203 | 206 |
| 207 // Get the visibility of the underlying compositor. | |
|
piman
2015/02/18 16:26:42
nit: Gets
Chirantan Ekbote
2015/02/18 19:26:50
Done.
| |
| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 LayerAnimatorCollection layer_animator_collection_; | 336 LayerAnimatorCollection layer_animator_collection_; |
| 331 | 337 |
| 332 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 338 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 333 | 339 |
| 334 DISALLOW_COPY_AND_ASSIGN(Compositor); | 340 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 335 }; | 341 }; |
| 336 | 342 |
| 337 } // namespace ui | 343 } // namespace ui |
| 338 | 344 |
| 339 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 345 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |