Add swapBuffer call to SkGLContextHelper.
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/26701002
git-svn-id: http://skia.googlecode.com/svn/trunk/include@11682 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/gl/SkANGLEGLContext.h b/gpu/gl/SkANGLEGLContext.h
index 63765a0..99ef4e9 100644
--- a/gpu/gl/SkANGLEGLContext.h
+++ b/gpu/gl/SkANGLEGLContext.h
@@ -22,6 +22,7 @@
virtual ~SkANGLEGLContext();
virtual void makeCurrent() const SK_OVERRIDE;
+ virtual void swapBuffers() const SK_OVERRIDE;
class AutoContextRestore {
public:
diff --git a/gpu/gl/SkDebugGLContext.h b/gpu/gl/SkDebugGLContext.h
index 2437aae..545ef40 100644
--- a/gpu/gl/SkDebugGLContext.h
+++ b/gpu/gl/SkDebugGLContext.h
@@ -16,6 +16,7 @@
SkDebugGLContext() {};
virtual void makeCurrent() const SK_OVERRIDE {};
+ virtual void swapBuffers() const SK_OVERRIDE {};
protected:
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
diff --git a/gpu/gl/SkGLContextHelper.h b/gpu/gl/SkGLContextHelper.h
index 97d416b..44eb509 100644
--- a/gpu/gl/SkGLContextHelper.h
+++ b/gpu/gl/SkGLContextHelper.h
@@ -34,6 +34,18 @@
virtual void makeCurrent() const = 0;
+ /**
+ * The primary purpose of this function it to provide a means of scheduling
+ * work on the GPU (since all of the subclasses create primary buffers for
+ * testing that are small and not meant to be rendered to the screen).
+ *
+ * If the drawing surface provided by the platform is double buffered this
+ * call will cause the platform to swap which buffer is currently being
+ * targeted. If the current surface does not include a back buffer, this
+ * call has no effect.
+ */
+ virtual void swapBuffers() const = 0;
+
bool hasExtension(const char* extensionName) const {
SkASSERT(NULL != fGL);
return fExtensions.has(extensionName);
diff --git a/gpu/gl/SkMesaGLContext.h b/gpu/gl/SkMesaGLContext.h
index 6470d2e..55235fa 100644
--- a/gpu/gl/SkMesaGLContext.h
+++ b/gpu/gl/SkMesaGLContext.h
@@ -22,6 +22,7 @@
virtual ~SkMesaGLContext();
virtual void makeCurrent() const SK_OVERRIDE;
+ virtual void swapBuffers() const SK_OVERRIDE;
class AutoContextRestore {
public:
diff --git a/gpu/gl/SkNativeGLContext.h b/gpu/gl/SkNativeGLContext.h
index 27a8f09..a18c443 100644
--- a/gpu/gl/SkNativeGLContext.h
+++ b/gpu/gl/SkNativeGLContext.h
@@ -30,6 +30,7 @@
virtual ~SkNativeGLContext();
virtual void makeCurrent() const SK_OVERRIDE;
+ virtual void swapBuffers() const SK_OVERRIDE;
class AutoContextRestore {
public:
diff --git a/gpu/gl/SkNullGLContext.h b/gpu/gl/SkNullGLContext.h
index 4f2639c..df7812b 100644
--- a/gpu/gl/SkNullGLContext.h
+++ b/gpu/gl/SkNullGLContext.h
@@ -17,6 +17,8 @@
virtual void makeCurrent() const SK_OVERRIDE {};
+ virtual void swapBuffers() const SK_OVERRIDE {};
+
protected:
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;