aboutsummaryrefslogtreecommitdiffstats
path: root/bench/BenchGpuTimer_gl.h
diff options
context:
space:
mode:
Diffstat (limited to 'bench/BenchGpuTimer_gl.h')
-rw-r--r--bench/BenchGpuTimer_gl.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/bench/BenchGpuTimer_gl.h b/bench/BenchGpuTimer_gl.h
new file mode 100644
index 0000000..ac23482
--- /dev/null
+++ b/bench/BenchGpuTimer_gl.h
@@ -0,0 +1,33 @@
+#ifndef SkBenchGpuTimer_DEFINED
+#define SkBenchGpuTimer_DEFINED
+
+#if defined(SK_MESA)
+ #include <GL/osmesa.h>
+
+#elif defined(SK_BUILD_FOR_WIN32)
+ #define WIN32_LEAN_AND_MEAN 1
+ #include <Windows.h>
+ #include <GL/GL.h>
+
+#elif defined(SK_BUILD_FOR_MAC)
+ #include <OpenGL/gl.h>
+
+#elif defined(SK_BUILD_FOR_UNIX)
+ #include <GL/gl.h>
+
+#else
+ #error unsupported platform
+#endif
+
+class BenchGpuTimer {
+public:
+ BenchGpuTimer();
+ ~BenchGpuTimer();
+ void startGpu();
+ double endGpu();
+private:
+ GLuint fQuery;
+ int fStarted;
+};
+
+#endif