| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "gl/SkGLContext.h" | 8 #include "gl/SkGLContext.h" |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { |
| 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_O
VERRIDE; | |
| 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; | 11 return NULL; |
| 47 } | 12 } |
| 48 | 13 |
| 49 void NACLGLContext::makeCurrent() const { | |
| 50 } | |
| 51 | 14 |
| 52 void NACLGLContext::swapBuffers() const { | |
| 53 } | |
| 54 | |
| 55 } // anonymous namespace | |
| 56 | |
| 57 NACLGLContext* SkCreatePlatformGLContext() { | |
| 58 return SkNEW(NACLGLContext); | |
| 59 } | |
| 60 | |
| OLD | NEW |