Index: src/core/SkScalerContext.cpp |
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp |
index 3e20bf69ed6947d8ada8ae982623c2c511f9fcd4..fee1ff7908fc66cf25e0d30c9fc663ed4d7678e8 100644 |
--- a/src/core/SkScalerContext.cpp |
+++ b/src/core/SkScalerContext.cpp |
@@ -584,6 +584,7 @@ |
matrix.setTranslate(-SkIntToScalar(mask.fBounds.fLeft), |
-SkIntToScalar(mask.fBounds.fTop)); |
+ SkBitmap::Config config = SkBitmap::kA8_Config; |
paint.setAntiAlias(SkMask::kBW_Format != mask.fFormat); |
switch (mask.fFormat) { |
case SkMask::kBW_Format: |
@@ -607,17 +608,18 @@ |
SkRasterClip clip; |
clip.setRect(SkIRect::MakeWH(dstW, dstH)); |
- const SkImageInfo info = SkImageInfo::MakeA8(dstW, dstH); |
SkBitmap bm; |
+ bm.setConfig(config, dstW, dstH, dstRB); |
if (0 == dstRB) { |
- if (!bm.allocPixels(info)) { |
+ if (!bm.allocPixels()) { |
// can't allocate offscreen, so empty the mask and return |
sk_bzero(mask.fImage, mask.computeImageSize()); |
return; |
} |
+ bm.lockPixels(); |
} else { |
- bm.installPixels(info, mask.fImage, dstRB); |
+ bm.setPixels(mask.fImage); |
} |
sk_bzero(bm.getPixels(), bm.getSafeSize()); |