blob: a393c1dc28321e64254e88a4ed56e8c6485fcfaf [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
bungeman@google.combe9ad4e2011-06-07 19:16:02 +00008#ifndef SkBenchGpuTimer_DEFINED
9#define SkBenchGpuTimer_DEFINED
10
11#if defined(SK_MESA)
12 #include <GL/osmesa.h>
13
14#elif defined(SK_BUILD_FOR_WIN32)
15 #define WIN32_LEAN_AND_MEAN 1
16 #include <Windows.h>
17 #include <GL/GL.h>
18
19#elif defined(SK_BUILD_FOR_MAC)
20 #include <OpenGL/gl.h>
21
22#elif defined(SK_BUILD_FOR_UNIX)
23 #include <GL/gl.h>
24
25#else
26 #error unsupported platform
27#endif
28
29class BenchGpuTimer {
30public:
31 BenchGpuTimer();
32 ~BenchGpuTimer();
33 void startGpu();
34 double endGpu();
35private:
36 GLuint fQuery;
37 int fStarted;
38};
39
40#endif