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

Unified Diff: include/gpu/gl/SkGLContext.h

Issue 1451683002: Initial version of external_oes texture support and unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@target
Patch Set: again Created 5 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
« no previous file with comments | « include/gpu/gl/GrGLTypes.h ('k') | include/gpu/gl/angle/SkANGLEGLContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « include/gpu/gl/GrGLTypes.h ('k') | include/gpu/gl/angle/SkANGLEGLContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698