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

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

Issue 640283004: Refactor SkGLContext to be actually extendable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: win compile fix. Created 6 years, 2 months 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/SkMesaGLContext.h ('k') | src/gpu/gl/SkGLContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/gpu/gl/SkMesaGLContext.h ('k') | src/gpu/gl/SkGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698