| 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> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 if (!gl->validate()) { | 46 if (!gl->validate()) { |
| 47 SkDebugf("Failed to validate gl interface"); | 47 SkDebugf("Failed to validate gl interface"); |
| 48 this->destroyGLContext(); | 48 this->destroyGLContext(); |
| 49 return; | 49 return; |
| 50 } | 50 } |
| 51 | 51 |
| 52 fGLLibrary = dlopen( | 52 fGLLibrary = dlopen( |
| 53 "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.
dylib", | 53 "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.
dylib", |
| 54 RTLD_LAZY); | 54 RTLD_LAZY); |
| 55 | 55 |
| 56 this->init(gl.detach()); | 56 this->init(gl.release()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 IOSGLContext::~IOSGLContext() { | 59 IOSGLContext::~IOSGLContext() { |
| 60 this->teardown(); | 60 this->teardown(); |
| 61 this->destroyGLContext(); | 61 this->destroyGLContext(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void IOSGLContext::destroyGLContext() { | 64 void IOSGLContext::destroyGLContext() { |
| 65 if (fEAGLContext) { | 65 if (fEAGLContext) { |
| 66 if ([EAGLContext currentContext] == EAGLCTX) { | 66 if ([EAGLContext currentContext] == EAGLCTX) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 97 if (kGL_GrGLStandard == forcedGpuAPI) { | 97 if (kGL_GrGLStandard == forcedGpuAPI) { |
| 98 return NULL; | 98 return NULL; |
| 99 } | 99 } |
| 100 IOSGLContext* ctx = new IOSGLContext; | 100 IOSGLContext* ctx = new IOSGLContext; |
| 101 if (!ctx->isValid()) { | 101 if (!ctx->isValid()) { |
| 102 delete ctx; | 102 delete ctx; |
| 103 return NULL; | 103 return NULL; |
| 104 } | 104 } |
| 105 return ctx; | 105 return ctx; |
| 106 } | 106 } |
| OLD | NEW |