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/GLTestContext.h" | 8 #include "gl/GLTestContext.h" |
9 | 9 |
10 #define GL_GLEXT_PROTOTYPES | 10 #define GL_GLEXT_PROTOTYPES |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 eglsync, | 313 eglsync, |
314 EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, | 314 EGL_SYNC_FLUSH_COMMANDS_BIT_KHR, |
315 EGL_FOREVER_KHR); | 315 EGL_FOREVER_KHR); |
316 } | 316 } |
317 | 317 |
318 void EGLFenceSync::deleteFence(sk_gpu_test::PlatformFence platformFence) const { | 318 void EGLFenceSync::deleteFence(sk_gpu_test::PlatformFence platformFence) const { |
319 EGLSyncKHR eglsync = reinterpret_cast<EGLSyncKHR>(platformFence); | 319 EGLSyncKHR eglsync = reinterpret_cast<EGLSyncKHR>(platformFence); |
320 eglDestroySyncKHR(fDisplay, eglsync); | 320 eglDestroySyncKHR(fDisplay, eglsync); |
321 } | 321 } |
322 | 322 |
| 323 GR_STATIC_ASSERT(sizeof(EGLSyncKHR) <= sizeof(sk_gpu_test::PlatformFence)); |
| 324 |
323 } // anonymous namespace | 325 } // anonymous namespace |
324 | 326 |
325 namespace sk_gpu_test { | 327 namespace sk_gpu_test { |
326 GLTestContext *CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI, | 328 GLTestContext *CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI, |
327 GLTestContext *shareContext) { | 329 GLTestContext *shareContext) { |
328 SkASSERT(!shareContext); | 330 SkASSERT(!shareContext); |
329 if (shareContext) { | 331 if (shareContext) { |
330 return nullptr; | 332 return nullptr; |
331 } | 333 } |
332 EGLGLTestContext *ctx = new EGLGLTestContext(forcedGpuAPI); | 334 EGLGLTestContext *ctx = new EGLGLTestContext(forcedGpuAPI); |
333 if (!ctx->isValid()) { | 335 if (!ctx->isValid()) { |
334 delete ctx; | 336 delete ctx; |
335 return nullptr; | 337 return nullptr; |
336 } | 338 } |
337 return ctx; | 339 return ctx; |
338 } | 340 } |
339 } // namespace sk_gpu_test | 341 } // namespace sk_gpu_test |
340 | |
OLD | NEW |