Index: include/gpu/gl/SkGLContext.h |
diff --git a/include/gpu/gl/SkGLContext.h b/include/gpu/gl/SkGLContext.h |
index 75cfcfee045896013f7c6dae3239ecc2e4f96683..3420a47973228594d4d1f8f6fc24cca9df685f3c 100644 |
--- a/include/gpu/gl/SkGLContext.h |
+++ b/include/gpu/gl/SkGLContext.h |
@@ -14,8 +14,9 @@ |
/** |
* Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. |
* Provides a GrGLInterface struct of function pointers for the context. |
+ * This class is intended for Skia's testing needs and not for general |
+ * use. |
*/ |
- |
class SK_API SkGLContext : public SkRefCnt { |
public: |
~SkGLContext() override; |
@@ -36,6 +37,16 @@ public: |
void makeCurrent() const; |
+ /** Used for testing EGLImage integration. Take a GL_TEXTURE_2D and wraps it in an EGL Image */ |
+ virtual GrEGLImage texture2DToEGLImage(GrGLuint /*texID*/) const { return 0; } |
+ virtual void destroyEGLImage(GrEGLImage) const {} |
+ |
+ /** |
+ * Used for testing EGLImage integration. Takes a EGLImage and wraps it in a |
+ * GL_TEXTURE_EXTERNAL_OES. |
+ */ |
+ virtual GrGLuint eglImageToExternalTexture(GrEGLImage) const { return 0; } |
+ |
/** |
* The only purpose of this function it to provide a means of scheduling |
* work on the GPU (since all of the subclasses create primary buffers for |
@@ -59,6 +70,12 @@ public: |
*/ |
void testAbandon(); |
+ /** |
+ * Creates a new GL context of the same type and makes the returned context current |
+ * (if not null). |
+ */ |
+ virtual SkGLContext* createNew() const { return nullptr; } |
+ |
class GLFenceSync; // SkGpuFenceSync implementation that uses the OpenGL functionality. |
protected: |