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

Unified Diff: ui/gl/gl_surface.h

Issue 11359114: Use GLX_SGI_video_sync to get a vblank signal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_surface.h
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index 56d8ae7a126015b3ecba46466c7c87afcc578dc2..e87801c9e7d669c55a3cf4e485f7e25cd0c37b0c 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "ui/gfx/native_widget_types.h"
@@ -107,11 +108,15 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// Get the GL pixel format of the surface, if available.
virtual unsigned GetFormat();
+ typedef base::Callback<void(const base::TimeTicks timebase,
+ const base::TimeDelta interval)>
+ UpdateVSyncCallback;
+
// Get the time of the most recent screen refresh, along with the time
- // between consecutive refreshes. Returns false when these values are
- // unavailable.
- virtual bool GetVSyncParameters(base::TimeTicks* timebase,
- base::TimeDelta* interval);
+ // between consecutive refreshes. The callback is called as soon as
+ // the data is available (possibly never). The callback will not be called
+ // if the instance of this class is destroyed.
piman 2012/11/08 23:51:16 Can you just mention that possibly the callback is
jonathan.backer 2012/11/09 17:02:35 Done.
+ virtual void GetVSyncParameters(const UpdateVSyncCallback& callback);
// Create a GL surface that renders directly to a view.
static scoped_refptr<GLSurface> CreateViewGLSurface(
@@ -164,8 +169,7 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
virtual void* GetDisplay() OVERRIDE;
virtual void* GetConfig() OVERRIDE;
virtual unsigned GetFormat() OVERRIDE;
- virtual bool GetVSyncParameters(base::TimeTicks* timebase,
- base::TimeDelta* interval) OVERRIDE;
+ virtual void GetVSyncParameters(const UpdateVSyncCallback& callback) OVERRIDE;
GLSurface* surface() const { return surface_.get(); }

Powered by Google App Engine
This is Rietveld 408576698