aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/TestContext.cpp
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.cpp
parenta86952a5ef9e757832a016506709ce4827b059ec (diff)
skpbench: add option for gpu timing
Diffstat (limited to 'tools/gpu/TestContext.cpp')
-rw-r--r--tools/gpu/TestContext.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/gpu/TestContext.cpp b/tools/gpu/TestContext.cpp
index 8a78b903b1..90aba43880 100644
--- a/tools/gpu/TestContext.cpp
+++ b/tools/gpu/TestContext.cpp
@@ -8,8 +8,13 @@
#include "TestContext.h"
+#include "GpuTimer.h"
+
namespace sk_gpu_test {
-TestContext::TestContext() : fFenceSync(nullptr), fCurrentFenceIdx(0) {
+TestContext::TestContext()
+ : fFenceSync(nullptr)
+ , fGpuTimer(nullptr)
+ , fCurrentFenceIdx(0) {
memset(fFrameFences, 0, sizeof(fFrameFences));
}
@@ -21,6 +26,7 @@ TestContext::~TestContext() {
}
#endif
SkASSERT(!fFenceSync);
+ SkASSERT(!fGpuTimer);
}
void TestContext::makeCurrent() const { this->onPlatformMakeCurrent(); }
@@ -60,9 +66,9 @@ void TestContext::teardown() {
fFrameFences[i] = 0;
}
}
- delete fFenceSync;
- fFenceSync = nullptr;
+ fFenceSync.reset();
}
+ fGpuTimer.reset();
}
}