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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 EGL_FOREVER_KHR); | 310 EGL_FOREVER_KHR); |
311 } | 311 } |
312 | 312 |
313 void SkEGLFenceSync::deleteFence(SkPlatformGpuFence platformFence) const { | 313 void SkEGLFenceSync::deleteFence(SkPlatformGpuFence platformFence) const { |
314 EGLSyncKHR eglsync = static_cast<EGLSyncKHR>(platformFence); | 314 EGLSyncKHR eglsync = static_cast<EGLSyncKHR>(platformFence); |
315 eglDestroySyncKHR(fDisplay, eglsync); | 315 eglDestroySyncKHR(fDisplay, eglsync); |
316 } | 316 } |
317 | 317 |
318 } // anonymous namespace | 318 } // anonymous namespace |
319 | 319 |
320 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI) { | 320 SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, SkGLContext* s hareContext) { |
321 SkASSERT(!shareContext); | |
bsalomon
2016/01/20 15:26:07
Why these asserts rather than just return nullptr?
joshualitt
2016/01/20 15:45:20
I can see it both ways. It make it easier to spot
| |
321 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI); | 322 EGLGLContext* ctx = new EGLGLContext(forcedGpuAPI); |
322 if (!ctx->isValid()) { | 323 if (!ctx->isValid()) { |
323 delete ctx; | 324 delete ctx; |
324 return nullptr; | 325 return nullptr; |
325 } | 326 } |
326 return ctx; | 327 return ctx; |
327 } | 328 } |
328 | 329 |
OLD | NEW |