Index: src/core/SkScaledImageCache.cpp |
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp |
index 75dac7859829aca5677e2803a251886f381b1ba2..11a0ee448f9c7cd590ff81c3409afded24163d8d 100644 |
--- a/src/core/SkScaledImageCache.cpp |
+++ b/src/core/SkScaledImageCache.cpp |
@@ -48,10 +48,9 @@ struct Key { |
return false; |
} |
- size_t offset = bm.pixelRefOffset(); |
- size_t rowBytes = bm.rowBytes(); |
- int x = (offset % rowBytes) >> 2; |
- int y = offset / rowBytes; |
+ size_t x, y; |
+ SkTDivMod(bm.pixelRefOffset(), bm.rowBytes(), &y, &x); |
+ x >>= 2; |
fGenID = pr->getGenerationID(); |
fBounds.set(x, y, x + bm.width(), y + bm.height()); |