aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/TestContext.h
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-10-05 08:42:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-05 08:42:03 -0700
commitc6618dd1dadeac8b47b81fbee108c42cca8ab166 (patch)
tree749fdc785cffc5639d0b6d1ba375d6b9904aae83 /tools/gpu/TestContext.h
parenta86952a5ef9e757832a016506709ce4827b059ec (diff)
skpbench: add option for gpu timing
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..8722a337b3 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;
+ SkAutoTDelete<FenceSync> fFenceSync;
+ SkAutoTDelete<GpuTimer> fGpuTimer;
TestContext();