Index: include/gpu/GrContext.h |
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h |
index dd15767534500474809bf1fc6ab5d21f6fa1496b..f9c78ffbe3c32cd41c4ed890b839954e7c3263a8 100644 |
--- a/include/gpu/GrContext.h |
+++ b/include/gpu/GrContext.h |
@@ -960,6 +960,30 @@ public: |
void printCacheStats() const; |
#endif |
+ class GPUStats { |
+ public: |
+#if GR_GPU_STATS |
+ GPUStats() { this->reset(); } |
+ |
+ void reset() { fRenderTargetBinds = 0; fShaderCompilations = 0; } |
+ |
+ int renderTargetBinds() const { return fRenderTargetBinds; } |
+ void incRenderTargetBinds() { fRenderTargetBinds++; } |
+ int shaderCompilations() const { return fShaderCompilations; } |
+ void incShaderCompilations() { fShaderCompilations++; } |
+ private: |
+ int fRenderTargetBinds; |
+ int fShaderCompilations; |
+#else |
+ void incRenderTargetBinds() {} |
+ void incShaderCompilations() {} |
+#endif |
+ }; |
+ |
+#if GR_GPU_STATS |
+ const GPUStats* gpuStats() const; |
+#endif |
+ |
private: |
// Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer. |
enum BufferedDraw { |