| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include <GLES2/gl2.h> |
| 11 #include <EGL/egl.h> | 11 #include <EGL/egl.h> |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 class EGLGLContext : public SkGLContext { | 15 class EGLGLContext : public SkGLContext { |
| 16 public: | 16 public: |
| 17 EGLGLContext(GrGLStandard forcedGpuAPI); | 17 EGLGLContext(GrGLStandard forcedGpuAPI); |
| 18 virtual ~EGLGLContext() SK_OVERRIDE; | 18 ~EGLGLContext() SK_OVERRIDE; |
| 19 virtual void makeCurrent() const SK_OVERRIDE; | 19 void makeCurrent() const SK_OVERRIDE; |
| 20 virtual void swapBuffers() const SK_OVERRIDE; | 20 void swapBuffers() const SK_OVERRIDE; |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 void destroyGLContext(); | 23 void destroyGLContext(); |
| 24 | 24 |
| 25 EGLContext fContext; | 25 EGLContext fContext; |
| 26 EGLDisplay fDisplay; | 26 EGLDisplay fDisplay; |
| 27 EGLSurface fSurface; | 27 EGLSurface fSurface; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 EGLGLContext::EGLGLContext(GrGLStandard forcedGpuAPI) | 30 EGLGLContext::EGLGLContext(GrGLStandard forcedGpuAPI) |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { | 191 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { |
| 192 EGLGLContext* ctx = SkNEW_ARGS(EGLGLContext, (forcedGpuAPI)); | 192 EGLGLContext* ctx = SkNEW_ARGS(EGLGLContext, (forcedGpuAPI)); |
| 193 if (!ctx->isValid()) { | 193 if (!ctx->isValid()) { |
| 194 SkDELETE(ctx); | 194 SkDELETE(ctx); |
| 195 return NULL; | 195 return NULL; |
| 196 } | 196 } |
| 197 return ctx; | 197 return ctx; |
| 198 } | 198 } |
| 199 | 199 |
| OLD | NEW |