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

Unified Diff: ui/gl/gl_surface.h

Issue 11293194: ui: Prefer +/- operators to apply offsets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: floats 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..0813d7df1a97658a78a8b034b71b0191d0763e85 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,17 @@ 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: it could be immediately from this method,
+ // later via a PostTask to the current MessageLoop, or never (if we have
+ // no data source). We provide the strong guarantee that the callback will
+ // not be called once the instance of this class is destroyed.
+ virtual void GetVSyncParameters(const UpdateVSyncCallback& callback);
// Create a GL surface that renders directly to a view.
static scoped_refptr<GLSurface> CreateViewGLSurface(
@@ -164,8 +171,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(); }
« .gitmodules ('K') | « ui/gl/generate_bindings.py ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698