fix 8->1 bugs shown by removal of A1 config
BUG=
Review URL: https://codereview.chromium.org/91563003
git-svn-id: http://skia.googlecode.com/svn/trunk/src@12415 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkScalerContext.cpp b/core/SkScalerContext.cpp
index f4f2391..d4f23ae 100644
--- a/core/SkScalerContext.cpp
+++ b/core/SkScalerContext.cpp
@@ -531,8 +531,8 @@
static uint8_t pack_8_to_1(const uint8_t alpha[8]) {
unsigned bits = 0;
for (int i = 0; i < 8; ++i) {
- bits |= convert_8_to_1(alpha[i]);
bits <<= 1;
+ bits |= convert_8_to_1(alpha[i]);
}
return SkToU8(bits);
}
@@ -544,7 +544,7 @@
const int leftOverBits = width & 7;
uint8_t* dst = mask.fImage;
- const int dstPad = mask.fRowBytes - SkAlign8(width);
+ const int dstPad = mask.fRowBytes - SkAlign8(width)/8;
SkASSERT(dstPad >= 0);
const int srcPad = srcRB - width;