Index: include/gpu/gl/SkNullGLContext.h |
diff --git a/include/gpu/gl/SkNullGLContext.h b/include/gpu/gl/SkNullGLContext.h |
index 16621fc69675f848fa3176b64507d7e49bdabd74..35e94d2ab93d9e1338a8a8036dba2f15fd1d3b09 100644 |
--- a/include/gpu/gl/SkNullGLContext.h |
+++ b/include/gpu/gl/SkNullGLContext.h |
@@ -11,18 +11,25 @@ |
#include "SkGLContext.h" |
class SK_API SkNullGLContext : public SkGLContext { |
- |
public: |
- SkNullGLContext() {}; |
- |
+ virtual ~SkNullGLContext() 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 SkNullGLContext* Create(GrGLStandard forcedGpuAPI) { |
+ if (kGLES_GrGLStandard == forcedGpuAPI) { |
+ return NULL; |
+ } |
+ SkNullGLContext* ctx = SkNEW(SkNullGLContext); |
+ if (!ctx->isValid()) { |
+ SkDELETE(ctx); |
+ return NULL; |
+ } |
+ return ctx; |
+ } |
+ |
+private: |
+ SkNullGLContext(); |
}; |
#endif |