aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-07 18:24:43 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-07 18:24:43 +0000
commitbdb1be599436a894ab88dfc323d14c0afb496a6f (patch)
tree20ea17e3db9751769b02b815637d164f47e67d62
parent6c76d2410a087cedca932f9646977259b2ec056c (diff)
Added cache stats printout to tests
-rw-r--r--tests/Test.h2
-rw-r--r--tests/skia_test.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/Test.h b/tests/Test.h
index a3beb0c724..f87a7a07b2 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -103,10 +103,10 @@ namespace skiatest {
GpuTest() : Test() {
fContext = GetContext();
}
+ static GrContext* GetContext();
protected:
GrContext* fContext;
private:
- static GrContext* GetContext();
};
typedef SkTRegistry<Test*, void*> TestRegistry;
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 7913874bf4..5c80a01fc3 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -8,6 +8,10 @@
#include "SkGraphics.h"
#include "Test.h"
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#endif
+
using namespace skiatest;
// need to explicitly declare this, or we get some weird infinite loop llist
@@ -170,6 +174,16 @@ int main (int argc, char * const argv[]) {
count, failCount, skipCount);
}
+#if SK_SUPPORT_GPU
+
+#if GR_CACHE_STATS
+ GrContext *gr = GpuTest::GetContext();
+
+ gr->printCacheStats();
+#endif
+
+#endif
+
SkGraphics::Term();
return (failCount == 0) ? 0 : 1;