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

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

Issue 1306823003: skia: add ability to load command_buffer_gles2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: and NULL->nullptr, just because. Created 5 years, 4 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/GrGLInterface.h ('k') | include/views/SkOSWindow_Win.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
new file mode 100644
index 0000000000000000000000000000000000000000..7fece3c83c1a43eb7fd4d85bcfa0e08ae4fa7e51
--- /dev/null
+++ b/include/gpu/gl/command_buffer/SkCommandBufferGLContext.h
@@ -0,0 +1,66 @@
+
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SKCOMMANDBUFFERGLCONTEXT_DEFINED
+#define SKCOMMANDBUFFERGLCONTEXT_DEFINED
+
+#if SK_COMMAND_BUFFER
+
+#include "gl/SkGLContext.h"
+
+class SkCommandBufferGLContext : public SkGLContext {
+public:
+ ~SkCommandBufferGLContext() override;
+
+ static SkCommandBufferGLContext* Create(GrGLStandard forcedGpuAPI) {
+ if (kGL_GrGLStandard == forcedGpuAPI) {
+ return nullptr;
+ }
+ SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext;
+ if (!ctx->isValid()) {
+ delete ctx;
+ return nullptr;
+ }
+ return ctx;
+ }
+
+ static SkCommandBufferGLContext* Create(void* nativeWindow, int msaaSampleCount) {
+ SkCommandBufferGLContext* ctx = new SkCommandBufferGLContext(nativeWindow,
+ msaaSampleCount);
+ if (!ctx->isValid()) {
+ delete ctx;
+ return nullptr;
+ }
+ return ctx;
+ }
+
+ void presentCommandBuffer();
+
+ bool makeCurrent();
+ int getStencilBits();
+ int getSampleCount();
+
+private:
+ SkCommandBufferGLContext();
+ SkCommandBufferGLContext(void* nativeWindow, int msaaSampleCount);
+ void initializeGLContext(void* nativeWindow, const int* configAttribs,
+ const int* surfaceAttribs);
+ void destroyGLContext();
+
+ void onPlatformMakeCurrent() const override;
+ void onPlatformSwapBuffers() const override;
+ GrGLFuncPtr onPlatformGetProcAddress(const char* name) const override;
+
+ void* fContext;
+ void* fDisplay;
+ void* fSurface;
+ void* fConfig;
+};
+
+#endif // SK_COMMAND_BUFFER
+
+#endif
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | include/views/SkOSWindow_Win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698