Add number of draws to GrGpu stats
authorjoshualitt <joshualitt@chromium.org>
Tue, 8 Sep 2015 20:42:05 +0000 (13:42 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 8 Sep 2015 20:42:05 +0000 (13:42 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1333543002

src/gpu/GrGpu.h
src/gpu/GrTest.cpp

index 08837cc..ba9e85b 100644 (file)
@@ -331,6 +331,7 @@ public:
             fTextureCreates = 0;
             fTextureUploads = 0;
             fStencilAttachmentCreates = 0;
+            fNumDraws = 0;
         }
 
         int renderTargetBinds() const { return fRenderTargetBinds; }
@@ -342,6 +343,7 @@ public:
         int textureUploads() const { return fTextureUploads; }
         void incTextureUploads() { fTextureUploads++; }
         void incStencilAttachmentCreates() { fStencilAttachmentCreates++; }
+        void incNumDraws() { fNumDraws++; }
         void dump(SkString*);
 
     private:
@@ -350,6 +352,7 @@ public:
         int fTextureCreates;
         int fTextureUploads;
         int fStencilAttachmentCreates;
+        int fNumDraws;
 #else
         void dump(SkString*) {};
         void incRenderTargetBinds() {}
@@ -357,6 +360,7 @@ public:
         void incTextureCreates() {}
         void incTextureUploads() {}
         void incStencilAttachmentCreates() {}
+        void incNumDraws() {}
 #endif
     };
 
index a111ee5..0852b6d 100644 (file)
@@ -103,6 +103,7 @@ void GrGpu::Stats::dump(SkString* out) {
     out->appendf("Textures Created: %d\n", fTextureCreates);
     out->appendf("Texture Uploads: %d\n", fTextureUploads);
     out->appendf("Stencil Buffer Creates: %d\n", fStencilAttachmentCreates);
+    out->appendf("Number of draws: %d\n", fNumDraws);
 }
 #endif