diff options
author | djsollen <djsollen@google.com> | 2014-11-13 11:12:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-13 11:12:41 -0800 |
commit | e4545210c950f98d9fa20f51bc1be6c5591534bd (patch) | |
tree | 0485f434709c8c1ad9ffb43ea5a63e5c013fc71b /src/gpu/gl/angle | |
parent | 912c9ec6ee8e28724861f0ac2b746e970895f745 (diff) |
Cleanup GrContextFactory and make it's subclasses private
Review URL: https://codereview.chromium.org/723183002
Diffstat (limited to 'src/gpu/gl/angle')
-rw-r--r-- | src/gpu/gl/angle/SkANGLEGLContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/angle/SkANGLEGLContext.h | 47 |
2 files changed, 48 insertions, 1 deletions
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp index 232c866423..2cff750fa0 100644 --- a/src/gpu/gl/angle/SkANGLEGLContext.cpp +++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp @@ -6,7 +6,7 @@ * found in the LICENSE file. */ -#include "gl/SkANGLEGLContext.h" +#include "gl/angle/SkANGLEGLContext.h" SkANGLEGLContext::SkANGLEGLContext() : fContext(EGL_NO_CONTEXT) diff --git a/src/gpu/gl/angle/SkANGLEGLContext.h b/src/gpu/gl/angle/SkANGLEGLContext.h new file mode 100644 index 0000000000..dec3f9f2a7 --- /dev/null +++ b/src/gpu/gl/angle/SkANGLEGLContext.h @@ -0,0 +1,47 @@ + +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef SkANGLEGLContext_DEFINED +#define SkANGLEGLContext_DEFINED + +#if SK_ANGLE + +#include "gl/SkGLContext.h" + +#include <GLES2/gl2.h> +#include <EGL/egl.h> + +class SkANGLEGLContext : public SkGLContext { +public: + virtual ~SkANGLEGLContext() SK_OVERRIDE; + virtual void makeCurrent() const SK_OVERRIDE; + virtual void swapBuffers() const SK_OVERRIDE; + + static SkANGLEGLContext* Create(GrGLStandard forcedGpuAPI) { + if (kGL_GrGLStandard == forcedGpuAPI) { + return NULL; + } + SkANGLEGLContext* ctx = SkNEW(SkANGLEGLContext); + if (!ctx->isValid()) { + SkDELETE(ctx); + return NULL; + } + return ctx; + } + +private: + SkANGLEGLContext(); + void destroyGLContext(); + + EGLContext fContext; + EGLDisplay fDisplay; + EGLSurface fSurface; +}; + +#endif + +#endif |