aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BenchGpuTimer_gl.h
blob: a393c1dc28321e64254e88a4ed56e8c6485fcfaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#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