Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: tools/gpu/TestContext.h

Issue 2388433003: skpbench: add option for gpu timing (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/gpu/TestContext.h
diff --git a/tools/gpu/TestContext.h b/tools/gpu/TestContext.h
index ffa8cae8f9d76792d8e1a924500f396efb6f0861..07673e751fed9026e4c869d433882de67622654a 100644
--- a/tools/gpu/TestContext.h
+++ b/tools/gpu/TestContext.h
@@ -13,6 +13,8 @@
#include "../private/SkGpuFenceSync.h"
#include "../private/SkTemplates.h"
+class SkGpuTimer;
+
namespace sk_gpu_test {
/**
* An offscreen 3D context. This class is intended for Skia's internal testing needs and not
@@ -25,6 +27,10 @@ public:
virtual bool isValid() const = 0;
bool fenceSyncSupport() const { return fFenceSync != nullptr; }
+ SkGpuFenceSync* fenceSync() const { SkASSERT(fFenceSync); return fFenceSync; }
+
+ bool gpuTimingSupport() const { return fGpuTimer != nullptr; }
+ SkGpuTimer* gpuTimer() const { SkASSERT(fGpuTimer); return fGpuTimer; }
bool getMaxGpuFrameLag(int *maxFrameLag) const {
if (!fFenceSync) {
@@ -73,13 +79,9 @@ public:
/** Wait until all GPU work is finished. */
virtual void finish() = 0;
- /**
- * returns the fencesync object owned by this GLTestContext
- */
- SkGpuFenceSync *fenceSync() { return fFenceSync; }
-
protected:
- SkGpuFenceSync* fFenceSync;
+ SkGpuFenceSync* fFenceSync;
+ SkGpuTimer* fGpuTimer;
TestContext();

Powered by Google App Engine
This is Rietveld 408576698