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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 // Signals swap has been posted. | 284 // Signals swap has been posted. |
285 void OnSwapBuffersPosted(); | 285 void OnSwapBuffersPosted(); |
286 | 286 |
287 // Signals swap has completed. | 287 // Signals swap has completed. |
288 void OnSwapBuffersComplete(); | 288 void OnSwapBuffersComplete(); |
289 | 289 |
290 // Signals swap has aborted (e.g. lost context). | 290 // Signals swap has aborted (e.g. lost context). |
291 void OnSwapBuffersAborted(); | 291 void OnSwapBuffersAborted(); |
292 | 292 |
| 293 // If |interval_is_authoritative| is true, then |interval| is used as the |
| 294 // authoritative vsync interval for future calls to OnUpdateVSyncParameters(). |
293 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 295 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
294 base::TimeDelta interval); | 296 base::TimeDelta interval, |
| 297 bool interval_is_authoritative); |
295 | 298 |
296 // LayerTreeHostClient implementation. | 299 // LayerTreeHostClient implementation. |
297 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | 300 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |
298 virtual void DidBeginMainFrame() OVERRIDE {} | 301 virtual void DidBeginMainFrame() OVERRIDE {} |
299 virtual void Animate(double frame_begin_time) OVERRIDE {} | 302 virtual void Animate(double frame_begin_time) OVERRIDE {} |
300 virtual void Layout() OVERRIDE; | 303 virtual void Layout() OVERRIDE; |
301 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 304 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, |
302 float page_scale) OVERRIDE {} | 305 float page_scale) OVERRIDE {} |
303 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 306 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |
304 OVERRIDE; | 307 OVERRIDE; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // layers on. | 358 // layers on. |
356 float device_scale_factor_; | 359 float device_scale_factor_; |
357 | 360 |
358 int last_started_frame_; | 361 int last_started_frame_; |
359 int last_ended_frame_; | 362 int last_ended_frame_; |
360 | 363 |
361 bool next_draw_is_resize_; | 364 bool next_draw_is_resize_; |
362 | 365 |
363 bool disable_schedule_composite_; | 366 bool disable_schedule_composite_; |
364 | 367 |
| 368 base::TimeDelta authoritative_vsync_interval_; |
| 369 |
365 CompositorLock* compositor_lock_; | 370 CompositorLock* compositor_lock_; |
366 | 371 |
367 // Prevent more than one draw from being scheduled. | 372 // Prevent more than one draw from being scheduled. |
368 bool defer_draw_scheduling_; | 373 bool defer_draw_scheduling_; |
369 | 374 |
370 // Used to prevent Draw()s while a composite is in progress. | 375 // Used to prevent Draw()s while a composite is in progress. |
371 bool waiting_on_compositing_end_; | 376 bool waiting_on_compositing_end_; |
372 bool draw_on_compositing_end_; | 377 bool draw_on_compositing_end_; |
373 | 378 |
374 base::WeakPtrFactory<Compositor> schedule_draw_factory_; | 379 base::WeakPtrFactory<Compositor> schedule_draw_factory_; |
375 | 380 |
376 DISALLOW_COPY_AND_ASSIGN(Compositor); | 381 DISALLOW_COPY_AND_ASSIGN(Compositor); |
377 }; | 382 }; |
378 | 383 |
379 } // namespace ui | 384 } // namespace ui |
380 | 385 |
381 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 386 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |