diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/gl/command_buffer/SkCommandBufferGLContext.h | 22 | ||||
-rw-r--r-- | include/views/SkOSWindow_Mac.h | 2 | ||||
-rw-r--r-- | include/views/SkOSWindow_SDL.h | 2 | ||||
-rw-r--r-- | include/views/SkOSWindow_Unix.h | 2 | ||||
-rw-r--r-- | include/views/SkOSWindow_Win.h | 2 |
5 files changed, 21 insertions, 9 deletions
diff --git a/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h b/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h index 47f3fd967a..cf16c2299c 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; diff --git a/include/views/SkOSWindow_Mac.h b/include/views/SkOSWindow_Mac.h index 6ce898321f..66f0cdfde7 100644 --- a/include/views/SkOSWindow_Mac.h +++ b/include/views/SkOSWindow_Mac.h @@ -28,7 +28,7 @@ public: kANGLE_BackEndType, #endif // SK_ANGLE #if SK_COMMAND_BUFFER - kCommandBuffer_BackEndType, + kCommandBufferES2_BackEndType, #endif // SK_COMMAND_BUFFER }; diff --git a/include/views/SkOSWindow_SDL.h b/include/views/SkOSWindow_SDL.h index e08108add4..65ef07eea0 100644 --- a/include/views/SkOSWindow_SDL.h +++ b/include/views/SkOSWindow_SDL.h @@ -24,7 +24,7 @@ public: kANGLE_BackEndType, #endif // SK_ANGLE #if SK_COMMAND_BUFFER - kCommandBuffer_BackEndType, + kCommandBufferES2_BackEndType, #endif // SK_COMMAND_BUFFER }; diff --git a/include/views/SkOSWindow_Unix.h b/include/views/SkOSWindow_Unix.h index ecd0a14521..3395ab9d09 100644 --- a/include/views/SkOSWindow_Unix.h +++ b/include/views/SkOSWindow_Unix.h @@ -40,7 +40,7 @@ public: kANGLE_BackEndType, #endif // SK_ANGLE #if SK_COMMAND_BUFFER - kCommandBuffer_BackEndType, + kCommandBufferES2_BackEndType, #endif // SK_COMMAND_BUFFER }; diff --git a/include/views/SkOSWindow_Win.h b/include/views/SkOSWindow_Win.h index c1a68c621e..9e771c2c6a 100644 --- a/include/views/SkOSWindow_Win.h +++ b/include/views/SkOSWindow_Win.h @@ -42,7 +42,7 @@ public: kANGLE_BackEndType, #endif // SK_ANGLE #if SK_COMMAND_BUFFER - kCommandBuffer_BackEndType, + kCommandBufferES2_BackEndType, #endif // SK_COMMAND_BUFFER #endif // SK_SUPPORT_GPU }; |