Index: include/gpu/gl/SkANGLEGLContext.h |
diff --git a/include/gpu/gl/SkANGLEGLContext.h b/include/gpu/gl/SkANGLEGLContext.h |
index 18cdbdb213a71ae6a7c579d9e66e8654ce1dd1a9..797e997972a7982ce449d53e73cb854708debfca 100644 |
--- a/include/gpu/gl/SkANGLEGLContext.h |
+++ b/include/gpu/gl/SkANGLEGLContext.h |
@@ -17,19 +17,26 @@ |
class SkANGLEGLContext : public SkGLContext { |
public: |
- SkANGLEGLContext(); |
- |
- virtual ~SkANGLEGLContext(); |
- |
+ virtual ~SkANGLEGLContext() SK_OVERRIDE; |
virtual void makeCurrent() const SK_OVERRIDE; |
virtual void swapBuffers() const SK_OVERRIDE; |
-protected: |
- virtual const GrGLInterface* createGLContext( |
- GrGLStandard forcedGpuAPI) SK_OVERRIDE; |
- virtual void destroyGLContext() SK_OVERRIDE; |
+ static SkANGLEGLContext* Create(GrGLStandard forcedGpuAPI) { |
+ if (kGL_GrGLStandard == forcedGpuAPI) { |
+ return NULL; |
+ } |
+ SkANGLEGLContext* ctx = SkNEW(SkANGLEGLContext); |
+ if (!ctx->isValid()) { |
+ SkDELETE(ctx); |
+ return NULL; |
+ } |
+ return ctx; |
+ } |
private: |
+ SkANGLEGLContext(); |
+ void destroyGLContext(); |
+ |
EGLContext fContext; |
EGLDisplay fDisplay; |
EGLSurface fSurface; |