blob: 7c7b5c294902ff6686c9ab73f66291353af31b86 [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
bsalomon@google.com373a6632011-10-19 20:43:20 +000011class SkGLContext;
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000012
13class BenchGpuTimer {
14public:
bsalomon@google.com373a6632011-10-19 20:43:20 +000015 BenchGpuTimer(const SkGLContext* glctx);
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000016 ~BenchGpuTimer();
17 void startGpu();
18 double endGpu();
19private:
bsalomon@google.com373a6632011-10-19 20:43:20 +000020 unsigned fQuery;
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000021 int fStarted;
bsalomon@google.com373a6632011-10-19 20:43:20 +000022 const SkGLContext* fContext;
23 bool fSupported;
bungeman@google.combe9ad4e2011-06-07 19:16:02 +000024};
25
26#endif