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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 // Where possible, draws are scissored to a damage region calculated from | 167 // Where possible, draws are scissored to a damage region calculated from |
168 // changes to layer properties. This bypasses that and indicates that | 168 // changes to layer properties. This bypasses that and indicates that |
169 // the whole frame needs to be drawn. | 169 // the whole frame needs to be drawn. |
170 void ScheduleFullRedraw(); | 170 void ScheduleFullRedraw(); |
171 | 171 |
172 // Schedule redraw and append damage_rect to the damage region calculated | 172 // Schedule redraw and append damage_rect to the damage region calculated |
173 // from changes to layer properties. | 173 // from changes to layer properties. |
174 void ScheduleRedrawRect(const gfx::Rect& damage_rect); | 174 void ScheduleRedrawRect(const gfx::Rect& damage_rect); |
175 | 175 |
| 176 // Finishes all outstanding rendering on the GPU. |
| 177 void FinishAllRendering(); |
| 178 |
176 void SetLatencyInfo(const LatencyInfo& latency_info); | 179 void SetLatencyInfo(const LatencyInfo& latency_info); |
177 | 180 |
178 // Sets the compositor's device scale factor and size. | 181 // Sets the compositor's device scale factor and size. |
179 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); | 182 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); |
180 | 183 |
181 // Returns the size of the widget that is being drawn to in pixel coordinates. | 184 // Returns the size of the widget that is being drawn to in pixel coordinates. |
182 const gfx::Size& size() const { return size_; } | 185 const gfx::Size& size() const { return size_; } |
183 | 186 |
184 // Sets the background color used for areas that aren't covered by | 187 // Sets the background color used for areas that aren't covered by |
185 // the |root_layer|. | 188 // the |root_layer|. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // The manager of vsync parameters for this compositor. | 272 // The manager of vsync parameters for this compositor. |
270 scoped_refptr<CompositorVSyncManager> vsync_manager_; | 273 scoped_refptr<CompositorVSyncManager> vsync_manager_; |
271 | 274 |
272 // The device scale factor of the monitor that this compositor is compositing | 275 // The device scale factor of the monitor that this compositor is compositing |
273 // layers on. | 276 // layers on. |
274 float device_scale_factor_; | 277 float device_scale_factor_; |
275 | 278 |
276 int last_started_frame_; | 279 int last_started_frame_; |
277 int last_ended_frame_; | 280 int last_ended_frame_; |
278 | 281 |
279 bool next_draw_is_resize_; | |
280 | |
281 bool disable_schedule_composite_; | 282 bool disable_schedule_composite_; |
282 | 283 |
283 CompositorLock* compositor_lock_; | 284 CompositorLock* compositor_lock_; |
284 | 285 |
285 // Prevent more than one draw from being scheduled. | 286 // Prevent more than one draw from being scheduled. |
286 bool defer_draw_scheduling_; | 287 bool defer_draw_scheduling_; |
287 | 288 |
288 // Used to prevent Draw()s while a composite is in progress. | 289 // Used to prevent Draw()s while a composite is in progress. |
289 bool waiting_on_compositing_end_; | 290 bool waiting_on_compositing_end_; |
290 bool draw_on_compositing_end_; | 291 bool draw_on_compositing_end_; |
291 enum SwapState { SWAP_NONE, SWAP_POSTED, SWAP_COMPLETED }; | 292 enum SwapState { SWAP_NONE, SWAP_POSTED, SWAP_COMPLETED }; |
292 SwapState swap_state_; | 293 SwapState swap_state_; |
293 | 294 |
294 base::WeakPtrFactory<Compositor> schedule_draw_factory_; | 295 base::WeakPtrFactory<Compositor> schedule_draw_factory_; |
295 | 296 |
296 DISALLOW_COPY_AND_ASSIGN(Compositor); | 297 DISALLOW_COPY_AND_ASSIGN(Compositor); |
297 }; | 298 }; |
298 | 299 |
299 } // namespace ui | 300 } // namespace ui |
300 | 301 |
301 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 302 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |