| 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 <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 this->destroyGLContext(); | 277 this->destroyGLContext(); |
| 278 return; | 278 return; |
| 279 } | 279 } |
| 280 | 280 |
| 281 if (!gl->validate()) { | 281 if (!gl->validate()) { |
| 282 SkDebugf("Failed to validate gl interface"); | 282 SkDebugf("Failed to validate gl interface"); |
| 283 this->destroyGLContext(); | 283 this->destroyGLContext(); |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 | 286 |
| 287 this->init(gl.detach()); | 287 this->init(gl.release()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 | 290 |
| 291 GLXGLContext::~GLXGLContext() { | 291 GLXGLContext::~GLXGLContext() { |
| 292 this->teardown(); | 292 this->teardown(); |
| 293 this->destroyGLContext(); | 293 this->destroyGLContext(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void GLXGLContext::destroyGLContext() { | 296 void GLXGLContext::destroyGLContext() { |
| 297 if (fDisplay) { | 297 if (fDisplay) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s
hareContext) { | 336 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s
hareContext) { |
| 337 GLXGLContext* glxShareContext = reinterpret_cast<GLXGLContext*>(shareContext
); | 337 GLXGLContext* glxShareContext = reinterpret_cast<GLXGLContext*>(shareContext
); |
| 338 GLXGLContext *ctx = new GLXGLContext(forcedGpuAPI, glxShareContext); | 338 GLXGLContext *ctx = new GLXGLContext(forcedGpuAPI, glxShareContext); |
| 339 if (!ctx->isValid()) { | 339 if (!ctx->isValid()) { |
| 340 delete ctx; | 340 delete ctx; |
| 341 return nullptr; | 341 return nullptr; |
| 342 } | 342 } |
| 343 return ctx; | 343 return ctx; |
| 344 } | 344 } |
| OLD | NEW |