aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/TestContext.h
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-10-04 12:33:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-04 12:33:44 -0700
commitc06720d06faab3b01eba1b8693e0ac791f06dc96 (patch)
tree65e68119ef1d128aeb4bff876c8ae814306c3a81 /tools/gpu/TestContext.h
parentb3f543d955637c6e10d7109554b5a46c6e25291a (diff)
skpbench: add option for gpu timing
Adds a gpu timing option with a GL implementation. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2388433003 Review-Url: https://codereview.chromium.org/2388433003
Diffstat (limited to 'tools/gpu/TestContext.h')
-rw-r--r--tools/gpu/TestContext.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gpu/TestContext.h b/tools/gpu/TestContext.h
index d01cb02af2..d39b7446c6 100644
--- a/tools/gpu/TestContext.h
+++ b/tools/gpu/TestContext.h
@@ -14,6 +14,9 @@
#include "../private/SkTemplates.h"
namespace sk_gpu_test {
+
+class GpuTimer;
+
/**
* An offscreen 3D context. This class is intended for Skia's internal testing needs and not
* for general use.
@@ -27,6 +30,9 @@ public:
bool fenceSyncSupport() const { return fFenceSync != nullptr; }
FenceSync* fenceSync() { SkASSERT(fFenceSync); return fFenceSync; }
+ bool gpuTimingSupport() const { return fGpuTimer != nullptr; }
+ GpuTimer* gpuTimer() const { SkASSERT(fGpuTimer); return fGpuTimer; }
+
bool getMaxGpuFrameLag(int *maxFrameLag) const {
if (!fFenceSync) {
return false;
@@ -75,7 +81,8 @@ public:
virtual void finish() = 0;
protected:
- FenceSync* fFenceSync;
+ FenceSync* fFenceSync;
+ GpuTimer* fGpuTimer;
TestContext();