Index: include/gpu/gl/command_buffer/SkCommandBufferGLContext.h |
diff --git a/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h b/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h |
index 47f3fd967a3b665217864a8d24690452e20751bd..cf16c2299c72e32382ca0e624906eb14877d5743 100644 |
--- a/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h |
+++ b/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h |
@@ -16,8 +16,16 @@ class SkCommandBufferGLContext : public SkGLContext { |
public: |
~SkCommandBufferGLContext() override; |
- static SkCommandBufferGLContext* Create() { |
- SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext; |
+ static SkCommandBufferGLContext* CreateES2() { |
+ SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext(kGLES2_ContextVersion); |
+ if (!ctx->isValid()) { |
+ delete ctx; |
+ return nullptr; |
+ } |
+ return ctx; |
+ } |
+ static SkCommandBufferGLContext* CreateES3() { |
+ SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext(kGLES3_ContextVersion); |
if (!ctx->isValid()) { |
delete ctx; |
return nullptr; |
@@ -42,10 +50,14 @@ public: |
int getSampleCount(); |
private: |
- SkCommandBufferGLContext(); |
+ enum ContextVersion { |
+ kGLES2_ContextVersion, |
+ kGLES3_ContextVersion |
+ }; |
+ SkCommandBufferGLContext(ContextVersion minContextVersion); |
SkCommandBufferGLContext(void* nativeWindow, int msaaSampleCount); |
- void initializeGLContext(void* nativeWindow, const int* configAttribs, |
- const int* surfaceAttribs); |
+ void initializeGLContext(ContextVersion minContextVersion, void* nativeWindow, |
+ const int* configAttribs, const int* surfaceAttribs); |
void destroyGLContext(); |
void onPlatformMakeCurrent() const override; |