diff options
author | 2016-02-25 02:03:43 -0800 | |
---|---|---|
committer | 2016-02-25 02:03:43 -0800 | |
commit | 45c2c8166bbd84a87e29fdd344b39e36e8a28a3f (patch) | |
tree | 9288929fb75ee43b3676964a6abe2f8cab7b5f6d /include | |
parent | 3eed7ddb25408cdd1c437e65728bac115aeacbd1 (diff) |
Implement support for using GL ES 3.0 with command buffer
Adds a new 'api': --config gpu(api=commandbuffer3) for dm/nanobench.
BUG=skia:4943
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684413003
Review URL: https://codereview.chromium.org/1684413003
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 }; |