Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 12426019: Fix divide-by-zero in program cache tracking (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL_program.cpp
===================================================================
--- src/gpu/gl/GrGpuGL_program.cpp (revision 8271)
+++ src/gpu/gl/GrGpuGL_program.cpp (working copy)
@@ -33,7 +33,8 @@
SkDebugf("--- Program Cache ---\n");
SkDebugf("Total requests: %d\n", fTotalRequests);
SkDebugf("Cache misses: %d\n", fCacheMisses);
- SkDebugf("Cache miss %%: %f\n", (float)fCacheMisses/(float)fTotalRequests);
+ SkDebugf("Cache miss %%: %f\n", (fTotalRequests > 0)
+ ? (float)fCacheMisses/(float)fTotalRequests : 0.0f);
SkDebugf("---------------------\n");
#endif
}
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698