Index: src/core/SkBitmap.cpp |
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp |
index d3bbecd7066dfe4d826d5bd778e635c1e5215910..446926fde4b9827f82b689519aba3d4518093c50 100644 |
--- a/src/core/SkBitmap.cpp |
+++ b/src/core/SkBitmap.cpp |
@@ -911,9 +911,11 @@ bool get_upper_left_from_offset(SkBitmap::Config config, size_t offset, size_t r |
return true; |
} |
// Use integer division to find the correct y position. |
- *y = SkToS32(offset / rowBytes); |
// The remainder will be the x position, after we reverse get_sub_offset. |
- *x = SkToS32(offset % rowBytes); |
+ size_t xSizeT, ySizeT; |
reed1
2013/09/20 19:02:39
do we really need to have two local vars to call t
mtklein
2013/09/20 19:29:35
We could, but that'd force offset and rowBytes to
|
+ SkDivMod(offset, rowBytes, &ySizeT, &xSizeT); |
+ *y = SkToS32(ySizeT); |
+ *x = SkToS32(xSizeT); |
switch (config) { |
case SkBitmap::kA8_Config: |
// Fall through. |