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

Unified Diff: src/core/SkScaledImageCache.cpp

Issue 24159009: Add SkDivMod with a special case for ARM. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: appease gcc on 10.6 Created 7 years, 3 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/core/SkBitmap.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | tests/MathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698