Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: tools/gpu/gl/GLFenceSync.h

Issue 2383383002: Move GPU fences into sk_gpu_test (Closed)
Patch Set: Move GPU fences into sk_gpu_test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698