OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrTest.h" | 9 #include "GrTest.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 void GrContext::dumpCacheStats(SkString* out) const { | 45 void GrContext::dumpCacheStats(SkString* out) const { |
46 #if GR_CACHE_STATS | 46 #if GR_CACHE_STATS |
47 fResourceCache->dumpStats(out); | 47 fResourceCache->dumpStats(out); |
48 #endif | 48 #endif |
49 } | 49 } |
50 | 50 |
51 void GrContext::printCacheStats() const { | 51 void GrContext::printCacheStats() const { |
52 SkString out; | 52 SkString out; |
53 this->dumpCacheStats(&out); | 53 this->dumpCacheStats(&out); |
54 SkDebugf(out.c_str()); | 54 SkDebugf("%s", out.c_str()); |
55 } | 55 } |
56 | 56 |
57 void GrContext::dumpGpuStats(SkString* out) const { | 57 void GrContext::dumpGpuStats(SkString* out) const { |
58 #if GR_GPU_STATS | 58 #if GR_GPU_STATS |
59 return fGpu->stats()->dump(out); | 59 return fGpu->stats()->dump(out); |
60 #endif | 60 #endif |
61 } | 61 } |
62 | 62 |
63 void GrContext::printGpuStats() const { | 63 void GrContext::printGpuStats() const { |
64 SkString out; | 64 SkString out; |
65 this->dumpGpuStats(&out); | 65 this->dumpGpuStats(&out); |
66 SkDebugf(out.c_str()); | 66 SkDebugf("%s", out.c_str()); |
67 } | 67 } |
68 | 68 |
69 #if GR_GPU_STATS | 69 #if GR_GPU_STATS |
70 void GrGpu::Stats::dump(SkString* out) { | 70 void GrGpu::Stats::dump(SkString* out) { |
71 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds); | 71 out->appendf("Render Target Binds: %d\n", fRenderTargetBinds); |
72 out->appendf("Shader Compilations: %d\n", fShaderCompilations); | 72 out->appendf("Shader Compilations: %d\n", fShaderCompilations); |
73 out->appendf("Textures Created: %d\n", fTextureCreates); | 73 out->appendf("Textures Created: %d\n", fTextureCreates); |
74 out->appendf("Texture Uploads: %d\n", fTextureUploads); | 74 out->appendf("Texture Uploads: %d\n", fTextureUploads); |
75 } | 75 } |
76 #endif | 76 #endif |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 264 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
265 // resources in the buffer pools. | 265 // resources in the buffer pools. |
266 SkDELETE(fDrawBuffer); | 266 SkDELETE(fDrawBuffer); |
267 SkDELETE(fDrawBufferVBAllocPool); | 267 SkDELETE(fDrawBufferVBAllocPool); |
268 SkDELETE(fDrawBufferIBAllocPool); | 268 SkDELETE(fDrawBufferIBAllocPool); |
269 | 269 |
270 fDrawBuffer = NULL; | 270 fDrawBuffer = NULL; |
271 fDrawBufferVBAllocPool = NULL; | 271 fDrawBufferVBAllocPool = NULL; |
272 fDrawBufferIBAllocPool = NULL; | 272 fDrawBufferIBAllocPool = NULL; |
273 } | 273 } |
OLD | NEW |