kkinnunen | 9e61bb7 | 2014-10-09 05:24:15 -0700 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | #include "gl/SkGLContext.h" |
| 9 | |
| 10 | #include <GLES2/gl2.h> |
| 11 | #include <EGL/egl.h> |
| 12 | |
| 13 | namespace { |
| 14 | class NACLGLContext : public SkGLContext { |
| 15 | public: |
| 16 | SkGLContextEGL(); |
| 17 | |
| 18 | virtual ~NACLGLContext(); |
| 19 | |
| 20 | virtual void makeCurrent() const SK_OVERRIDE; |
| 21 | virtual void swapBuffers() const SK_OVERRIDE; |
| 22 | protected: |
| 23 | virtual const GrGLInterface* createGLContext(GrGLStandard forcedGpuAPI) SK_OVERRIDE; |
| 24 | virtual void destroyGLContext() SK_OVERRIDE; |
| 25 | |
| 26 | private: |
| 27 | EGLContext fContext; |
| 28 | EGLDisplay fDisplay; |
| 29 | EGLSurface fSurface; |
| 30 | }; |
| 31 | |
| 32 | NACLGLContext::NACLGLContext() |
| 33 | : fContext(NULL) |
| 34 | , fDisplay(NULL) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | NACLGLContext::~NACLGLContext() { |
| 39 | this->destroyGLContext(); |
| 40 | } |
| 41 | |
| 42 | void NACLGLContext::destroyGLContext() { |
| 43 | } |
| 44 | |
| 45 | const GrGLInterface* NACLGLContext::createGLContext(GrGLStandard forcedGpuAPI) { |
| 46 | return NULL; |
| 47 | } |
| 48 | |
| 49 | void NACLGLContext::makeCurrent() const { |
| 50 | } |
| 51 | |
| 52 | void NACLGLContext::swapBuffers() const { |
| 53 | } |
| 54 | |
| 55 | } // anonymous namespace |
| 56 | |
| 57 | NACLGLContext* SkCreatePlatformGLContext() { |
| 58 | return SkNEW(NACLGLContext); |
| 59 | } |
| 60 | |