| 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> |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 this->destroyGLContext(); | 172 this->destroyGLContext(); |
| 173 continue; | 173 continue; |
| 174 } | 174 } |
| 175 | 175 |
| 176 if (!gl->validate()) { | 176 if (!gl->validate()) { |
| 177 SkDebugf("Failed to validate gl interface.\n"); | 177 SkDebugf("Failed to validate gl interface.\n"); |
| 178 this->destroyGLContext(); | 178 this->destroyGLContext(); |
| 179 continue; | 179 continue; |
| 180 } | 180 } |
| 181 | 181 |
| 182 this->init(gl.detach(), SkEGLFenceSync::CreateIfSupported(fDisplay)); | 182 this->init(gl.release(), SkEGLFenceSync::CreateIfSupported(fDisplay)); |
| 183 break; | 183 break; |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 EGLGLContext::~EGLGLContext() { | 187 EGLGLContext::~EGLGLContext() { |
| 188 this->teardown(); | 188 this->teardown(); |
| 189 this->destroyGLContext(); | 189 this->destroyGLContext(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void EGLGLContext::destroyGLContext() { | 192 void EGLGLContext::destroyGLContext() { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 return nullptr; | 324 return nullptr; |
| 325 } | 325 } |
| 326 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI); | 326 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI); |
| 327 if (!ctx->isValid()) { | 327 if (!ctx->isValid()) { |
| 328 delete ctx; | 328 delete ctx; |
| 329 return nullptr; | 329 return nullptr; |
| 330 } | 330 } |
| 331 return ctx; | 331 return ctx; |
| 332 } | 332 } |
| 333 | 333 |
| OLD | NEW |