Chromium Code Reviews| Index: tools/gpu/gl/GLFenceSync.h |
| diff --git a/tools/gpu/gl/GLFenceSync.h b/tools/gpu/gl/GLFenceSync.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..367e2be18a1b964b318a5826410f77db3a58df16 |
| --- /dev/null |
| +++ b/tools/gpu/gl/GLFenceSync.h |
| @@ -0,0 +1,48 @@ |
| +/* |
| + * Copyright 2016 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef GLFenceSync_DEFINED |
| +#define GLFenceSync_DEFINED |
| + |
| +#include "FenceSync.h" |
| +#include "gl/GrGLFunctions.h" |
| + |
| +namespace sk_gpu_test { |
| + |
| +class GLTestContext; |
| + |
| +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.
|
| +public: |
| + static GLFenceSync* CreateIfSupported(const GLTestContext*); |
| + |
| + PlatformFence SK_WARN_UNUSED_RESULT insertFence() const override; |
| + bool waitFence(PlatformFence fence) const override; |
| + void deleteFence(PlatformFence fence) const override; |
| + |
| +private: |
| + GLFenceSync() {} |
| + |
| + static const GrGLenum GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; |
| + static const GrGLenum GL_WAIT_FAILED = 0x911d; |
| + static const GrGLbitfield GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; |
| + |
| + typedef struct __GLsync *GLsync; |
| + |
| + typedef GLsync (GR_GL_FUNCTION_TYPE* GLFenceSyncProc) (GrGLenum, GrGLbitfield); |
| + typedef GrGLenum (GR_GL_FUNCTION_TYPE* GLClientWaitSyncProc) (GLsync, GrGLbitfield, GrGLuint64); |
| + typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GLDeleteSyncProc) (GLsync); |
| + |
| + GLFenceSyncProc fGLFenceSync; |
| + GLClientWaitSyncProc fGLClientWaitSync; |
| + GLDeleteSyncProc fGLDeleteSync; |
| + |
| + typedef FenceSync INHERITED; |
| +}; |
| + |
| +} |
| + |
| +#endif |