aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScaledImageCache.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-26 19:22:54 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-26 19:22:54 +0000
commit2c86fbb0b14a1f674bf56ea5ad6a086cc004a76e (patch)
tree39c7755bf8736c85ae8c3d35d8e4c273140932b1 /src/core/SkScaledImageCache.cpp
parent52753b93518d2ad3322c2807799eacb869e9f9d9 (diff)
Add SkDivMod with a special case for ARM.
BUG=skia:1663 R=djsollen@google.com, tomhudson@google.com, reed@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/24159009 git-svn-id: http://skia.googlecode.com/svn/trunk@11482 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkScaledImageCache.cpp')
-rw-r--r--src/core/SkScaledImageCache.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp
index 75dac78598..11a0ee448f 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());