| 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);
|
| +}
|
| +
|
|
|