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

Unified Diff: src/core/SkScalerContext.cpp

Issue 91563003: fix 8->1 bugs shown by removal of A1 config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index f4f23911b0e3aedbae6194e6efa997a0c96cd946..d4f23ae3d26d37a77a10abb6efb5c1e01257ce19 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -531,8 +531,8 @@ static inline int convert_8_to_1(unsigned byte) {
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 @@ static void packA8ToA1(const SkMask& mask, const uint8_t* src, size_t srcRB) {
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698