Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: ui/compositor/compositor.h

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 54ddbacb Rebase. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 // Signals swap has been posted. 238 // Signals swap has been posted.
239 void OnSwapBuffersPosted(); 239 void OnSwapBuffersPosted();
240 240
241 // Signals swap has completed. 241 // Signals swap has completed.
242 void OnSwapBuffersComplete(); 242 void OnSwapBuffersComplete();
243 243
244 // Signals swap has aborted (e.g. lost context). 244 // Signals swap has aborted (e.g. lost context).
245 void OnSwapBuffersAborted(); 245 void OnSwapBuffersAborted();
246 246
247 // If |interval_is_authoritative| is true, then |interval| is used as the
248 // authoritative vsync interval for future calls to OnUpdateVSyncParameters().
247 void OnUpdateVSyncParameters(base::TimeTicks timebase, 249 void OnUpdateVSyncParameters(base::TimeTicks timebase,
248 base::TimeDelta interval); 250 base::TimeDelta interval,
251 bool interval_is_authoritative);
249 252
250 // LayerTreeHostClient implementation. 253 // LayerTreeHostClient implementation.
251 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} 254 virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
252 virtual void DidBeginMainFrame() OVERRIDE {} 255 virtual void DidBeginMainFrame() OVERRIDE {}
253 virtual void Animate(double frame_begin_time) OVERRIDE {} 256 virtual void Animate(double frame_begin_time) OVERRIDE {}
254 virtual void Layout() OVERRIDE; 257 virtual void Layout() OVERRIDE;
255 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, 258 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta,
256 float page_scale) OVERRIDE {} 259 float page_scale) OVERRIDE {}
257 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) 260 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback)
258 OVERRIDE; 261 OVERRIDE;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // layers on. 312 // layers on.
310 float device_scale_factor_; 313 float device_scale_factor_;
311 314
312 int last_started_frame_; 315 int last_started_frame_;
313 int last_ended_frame_; 316 int last_ended_frame_;
314 317
315 bool next_draw_is_resize_; 318 bool next_draw_is_resize_;
316 319
317 bool disable_schedule_composite_; 320 bool disable_schedule_composite_;
318 321
322 base::TimeDelta authoritative_vsync_interval_;
323
319 CompositorLock* compositor_lock_; 324 CompositorLock* compositor_lock_;
320 325
321 // Prevent more than one draw from being scheduled. 326 // Prevent more than one draw from being scheduled.
322 bool defer_draw_scheduling_; 327 bool defer_draw_scheduling_;
323 328
324 // Used to prevent Draw()s while a composite is in progress. 329 // Used to prevent Draw()s while a composite is in progress.
325 bool waiting_on_compositing_end_; 330 bool waiting_on_compositing_end_;
326 bool draw_on_compositing_end_; 331 bool draw_on_compositing_end_;
327 332
328 base::WeakPtrFactory<Compositor> schedule_draw_factory_; 333 base::WeakPtrFactory<Compositor> schedule_draw_factory_;
329 334
330 DISALLOW_COPY_AND_ASSIGN(Compositor); 335 DISALLOW_COPY_AND_ASSIGN(Compositor);
331 }; 336 };
332 337
333 } // namespace ui 338 } // namespace ui
334 339
335 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 340 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698