Added GPU resource cache stats printing to render_pictures
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 13 Sep 2012 15:40:37 +0000 (15:40 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 13 Sep 2012 15:40:37 +0000 (15:40 +0000)
https://codereview.appspot.com/6492104/

git-svn-id: http://skia.googlecode.com/svn/trunk@5523 2bbb7eff-a529-9590-31e7-b0007b416f81

tools/PictureRenderer.h
tools/render_pictures_main.cpp

index afcd7f08b09370eb7de37269047f61548de100ed..9eeb03d767c5c1c0b1d442dc9a638798f1850c43 100644 (file)
@@ -79,6 +79,10 @@ public:
             return NULL;
         }
     }
+
+    GrContext* getGrContext() {
+        return fGrContext;
+    }
 #endif
 
     PictureRenderer()
index 976441dd0a3dd3733cbb0b6b87acb116f24bcde9..5ec2ede3e7d507a65c9388a6d8a93e00fd6a9c73 100644 (file)
@@ -289,6 +289,16 @@ int main(int argc, char* const argv[]) {
         process_input(inputs[i], outputDir, *renderer);
     }
 
+#if SK_SUPPORT_GPU
+#if GR_CACHE_STATS
+    if (renderer->isUsingGpuDevice()) {
+        GrContext* ctx = renderer->getGrContext();
+
+        ctx->printCacheStats();
+    }
+#endif
+#endif
+
     SkDELETE(renderer);
     SkGraphics::Term();
 }