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

Unified Diff: src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp

Issue 630843002: Make the Sk GL context class an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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
Index: src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp
diff --git a/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp b/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp
index 334be1d9542abb0b06d9904e8a52ba66bb5e15cc..5901aa87ea99a09018e7969cbde7a74bb3e34a3d 100644
--- a/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp
+++ b/src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp
@@ -5,33 +5,56 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "gl/SkNativeGLContext.h"
+#include "gl/SkGLContext.h"
-SkNativeGLContext::AutoContextRestore::AutoContextRestore() {
-}
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
-SkNativeGLContext::AutoContextRestore::~AutoContextRestore() {
-}
+namespace {
+class SkGLContextNACL : public SkGLContext {
+public:
+ SkGLContextEGL();
+
+ virtual ~SkGLContextNACL();
+
+ virtual void makeCurrent() const SK_OVERRIDE;
+ virtual void swapBuffers() const SK_OVERRIDE;
+protected:
+ virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_OVERRIDE;
+ virtual void destroyGLContext() SK_OVERRIDE;
+
+private:
+ EGLContext fContext;
+ EGLDisplay fDisplay;
+ EGLSurface fSurface;
+};
-SkNativeGLContext::SkNativeGLContext()
+SkGLContextNACL::SkGLContextNACL()
: fContext(NULL)
, fDisplay(NULL)
{
}
-SkNativeGLContext::~SkNativeGLContext() {
+SkGLContextNACL::~SkGLContextNACL() {
this->destroyGLContext();
}
-void SkNativeGLContext::destroyGLContext() {
+void SkGLContextNACL::destroyGLContext() {
}
-const GrGLInterface* SkNativeGLContext::createGLContext(GrGLStandard forcedGpuAPI) {
+const GrGLInterface* SkGLContextNACL::createGLContext(GrGLStandard forcedGpuAPI) {
return NULL;
}
-void SkNativeGLContext::makeCurrent() const {
+void SkGLContextNACL::makeCurrent() const {
}
-void SkNativeGLContext::swapBuffers() const {
+void SkGLContextNACL::swapBuffers() const {
}
+
+} // anonymous namespace
+
+SkGLContextNACL* SkCreateGLContext() {
+ return SkNEW(SkGLContextNACL);
+}
+

Powered by Google App Engine
This is Rietveld 408576698