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

Unified Diff: include/gpu/gl/command_buffer/SkCommandBufferGLContext.h

Issue 1684413003: Implement support for using GL ES 3.0 with command buffer (Closed) Base URL: https://skia.googlesource.com/skia.git@no-texture-rectangle-gles
Patch Set: comment wording Created 4 years, 10 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 | « dm/DMGpuSupport.h ('k') | include/views/SkOSWindow_Mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/views/SkOSWindow_Mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698