| 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 | 8 |
| 9 #include "gl/SkGLContext.h" | 9 #include "gl/SkGLContext.h" |
| 10 #import <OpenGLES/EAGL.h> | 10 #import <OpenGLES/EAGL.h> |
| 11 | 11 |
| 12 #define EAGLCTX ((EAGLContext*)(fEAGLContext)) | 12 #define EAGLCTX ((EAGLContext*)(fEAGLContext)) |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class IOSGLContext : public SkGLContext { | 16 class IOSGLContext : public SkGLContext { |
| 17 public: | 17 public: |
| 18 IOSGLContext(); | 18 IOSGLContext(); |
| 19 ~IOSGLContext() SK_OVERRIDE; | 19 ~IOSGLContext() override; |
| 20 void makeCurrent() const SK_OVERRIDE; | 20 void makeCurrent() const override; |
| 21 void swapBuffers() const SK_OVERRIDE; | 21 void swapBuffers() const override; |
| 22 | 22 |
| 23 private: | 23 private: |
| 24 void destroyGLContext(); | 24 void destroyGLContext(); |
| 25 | 25 |
| 26 void* fEAGLContext; | 26 void* fEAGLContext; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 IOSGLContext::IOSGLContext() | 29 IOSGLContext::IOSGLContext() |
| 30 : fEAGLContext(NULL) { | 30 : fEAGLContext(NULL) { |
| 31 | 31 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return NULL; | 76 return NULL; |
| 77 } | 77 } |
| 78 IOSGLContext* ctx = SkNEW(IOSGLContext); | 78 IOSGLContext* ctx = SkNEW(IOSGLContext); |
| 79 if (!ctx->isValid()) { | 79 if (!ctx->isValid()) { |
| 80 SkDELETE(ctx); | 80 SkDELETE(ctx); |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 return ctx; | 83 return ctx; |
| 84 } | 84 } |
| 85 | 85 |
| OLD | NEW |