bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 1 | #ifndef SkBenchGpuTimer_DEFINED |
| 2 | #define SkBenchGpuTimer_DEFINED |
| 3 | |
| 4 | #if defined(SK_MESA) |
| 5 | #include <GL/osmesa.h> |
| 6 | |
| 7 | #elif defined(SK_BUILD_FOR_WIN32) |
| 8 | #define WIN32_LEAN_AND_MEAN 1 |
| 9 | #include <Windows.h> |
| 10 | #include <GL/GL.h> |
| 11 | |
| 12 | #elif defined(SK_BUILD_FOR_MAC) |
| 13 | #include <OpenGL/gl.h> |
| 14 | |
| 15 | #elif defined(SK_BUILD_FOR_UNIX) |
| 16 | #include <GL/gl.h> |
| 17 | |
| 18 | #else |
| 19 | #error unsupported platform |
| 20 | #endif |
| 21 | |
| 22 | class BenchGpuTimer { |
| 23 | public: |
| 24 | BenchGpuTimer(); |
| 25 | ~BenchGpuTimer(); |
| 26 | void startGpu(); |
| 27 | double endGpu(); |
| 28 | private: |
| 29 | GLuint fQuery; |
| 30 | int fStarted; |
| 31 | }; |
| 32 | |
| 33 | #endif |