patch from issue 886233004 at patchset 40001 (http://crrev.com/886233004#ps40001)

... with changes proposed in the review.

BUG=skia:

Review URL: https://codereview.chromium.org/894013002
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 88a3148..e47ad15 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -768,33 +768,13 @@
      */
     const Options& getOptions() const { return fOptions; }
 
-#if GR_CACHE_STATS
+    /** Prints cache stats to the string if GR_CACHE_STATS == 1. */
+    void dumpCacheStats(SkString*) const;
     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
+    /** Prints GPU stats to the string if GR_GPU_STATS == 1. */
+    void dumpGpuStats(SkString*) const;
+    void printGpuStats() const;
 
 private:
     GrGpu*                          fGpu;