diff options
author | 2013-03-21 12:46:01 +0000 | |
---|---|---|
committer | 2013-03-21 12:46:01 +0000 | |
commit | 174db77d1aa9bfa779cdb5ea2aac070af2883cdd (patch) | |
tree | 62a1b36535d6552f9a99cfa1f1178ba9b5afa0fb /src/gpu/gl/GrGpuGL_program.cpp | |
parent | 311d4eafab513adae3ef6c37dd4d573844bccd63 (diff) |
Fix divide-by-zero in program cache tracking.
This also adds tracking to developer builds.
Author: jvanverth@google.com
Reviewed By: robertphillips@google.com
Review URL: https://chromiumcodereview.appspot.com/12426019
git-svn-id: http://skia.googlecode.com/svn/trunk@8284 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGpuGL_program.cpp')
-rw-r--r-- | src/gpu/gl/GrGpuGL_program.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp index 5081089216..8111a03ca7 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -33,7 +33,8 @@ GrGpuGL::ProgramCache::~ProgramCache() { 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 } |