OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef GLFenceSync_DEFINED | |
9 #define GLFenceSync_DEFINED | |
10 | |
11 #include "FenceSync.h" | |
12 #include "gl/GrGLFunctions.h" | |
13 | |
14 namespace sk_gpu_test { | |
15 | |
16 class GLTestContext; | |
17 | |
18 class GLFenceSync : public FenceSync { | |
bsalomon
2016/10/03 17:54:00
Can the existence of this class be an implementati
csmartdalton
2016/10/03 19:05:40
Done.
| |
19 public: | |
20 static GLFenceSync* CreateIfSupported(const GLTestContext*); | |
21 | |
22 PlatformFence SK_WARN_UNUSED_RESULT insertFence() const override; | |
23 bool waitFence(PlatformFence fence) const override; | |
24 void deleteFence(PlatformFence fence) const override; | |
25 | |
26 private: | |
27 GLFenceSync() {} | |
28 | |
29 static const GrGLenum GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; | |
30 static const GrGLenum GL_WAIT_FAILED = 0x911d; | |
31 static const GrGLbitfield GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; | |
32 | |
33 typedef struct __GLsync *GLsync; | |
34 | |
35 typedef GLsync (GR_GL_FUNCTION_TYPE* GLFenceSyncProc) (GrGLenum, GrGLbitfiel d); | |
36 typedef GrGLenum (GR_GL_FUNCTION_TYPE* GLClientWaitSyncProc) (GLsync, GrGLbi tfield, GrGLuint64); | |
37 typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GLDeleteSyncProc) (GLsync); | |
38 | |
39 GLFenceSyncProc fGLFenceSync; | |
40 GLClientWaitSyncProc fGLClientWaitSync; | |
41 GLDeleteSyncProc fGLDeleteSync; | |
42 | |
43 typedef FenceSync INHERITED; | |
44 }; | |
45 | |
46 } | |
47 | |
48 #endif | |
OLD | NEW |