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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 // Signals swap has been posted. | 247 // Signals swap has been posted. |
248 void OnSwapBuffersPosted(); | 248 void OnSwapBuffersPosted(); |
249 | 249 |
250 // Signals swap has completed. | 250 // Signals swap has completed. |
251 void OnSwapBuffersComplete(); | 251 void OnSwapBuffersComplete(); |
252 | 252 |
253 // Signals swap has aborted (e.g. lost context). | 253 // Signals swap has aborted (e.g. lost context). |
254 void OnSwapBuffersAborted(); | 254 void OnSwapBuffersAborted(); |
255 | 255 |
| 256 // If |interval_is_authoritative| is true, then |interval| is used as the |
| 257 // authoritative vsync interval for future calls to OnUpdateVSyncParameters(). |
256 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 258 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
257 base::TimeDelta interval); | 259 base::TimeDelta interval, |
| 260 bool interval_is_authoritative); |
258 | 261 |
259 // LayerTreeHostClient implementation. | 262 // LayerTreeHostClient implementation. |
260 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | 263 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |
261 virtual void DidBeginMainFrame() OVERRIDE {} | 264 virtual void DidBeginMainFrame() OVERRIDE {} |
262 virtual void Animate(double frame_begin_time) OVERRIDE {} | 265 virtual void Animate(double frame_begin_time) OVERRIDE {} |
263 virtual void Layout() OVERRIDE; | 266 virtual void Layout() OVERRIDE; |
264 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 267 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, |
265 float page_scale) OVERRIDE {} | 268 float page_scale) OVERRIDE {} |
266 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 269 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
267 OVERRIDE; | 270 OVERRIDE; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // layers on. | 321 // layers on. |
319 float device_scale_factor_; | 322 float device_scale_factor_; |
320 | 323 |
321 int last_started_frame_; | 324 int last_started_frame_; |
322 int last_ended_frame_; | 325 int last_ended_frame_; |
323 | 326 |
324 bool next_draw_is_resize_; | 327 bool next_draw_is_resize_; |
325 | 328 |
326 bool disable_schedule_composite_; | 329 bool disable_schedule_composite_; |
327 | 330 |
| 331 base::TimeDelta authoritative_vsync_interval_; |
| 332 |
328 CompositorLock* compositor_lock_; | 333 CompositorLock* compositor_lock_; |
329 | 334 |
330 // Prevent more than one draw from being scheduled. | 335 // Prevent more than one draw from being scheduled. |
331 bool defer_draw_scheduling_; | 336 bool defer_draw_scheduling_; |
332 | 337 |
333 // Used to prevent Draw()s while a composite is in progress. | 338 // Used to prevent Draw()s while a composite is in progress. |
334 bool waiting_on_compositing_end_; | 339 bool waiting_on_compositing_end_; |
335 bool draw_on_compositing_end_; | 340 bool draw_on_compositing_end_; |
336 | 341 |
337 base::WeakPtrFactory<Compositor> schedule_draw_factory_; | 342 base::WeakPtrFactory<Compositor> schedule_draw_factory_; |
338 | 343 |
339 DISALLOW_COPY_AND_ASSIGN(Compositor); | 344 DISALLOW_COPY_AND_ASSIGN(Compositor); |
340 }; | 345 }; |
341 | 346 |
342 } // namespace ui | 347 } // namespace ui |
343 | 348 |
344 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 349 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |