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

Unified Diff: src/core/SkScalerContext.cpp

Issue 301283003: Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add guard for android Created 6 years, 7 months 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 | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidationUtils.h » ('j') | 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 fee1ff7908fc66cf25e0d30c9fc663ed4d7678e8..3e20bf69ed6947d8ada8ae982623c2c511f9fcd4 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -584,7 +584,6 @@ static void generateMask(const SkMask& mask, const SkPath& path,
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:
@@ -608,18 +607,17 @@ static void generateMask(const SkMask& mask, const SkPath& path,
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()) {
+ if (!bm.allocPixels(info)) {
// can't allocate offscreen, so empty the mask and return
sk_bzero(mask.fImage, mask.computeImageSize());
return;
}
- bm.lockPixels();
} else {
- bm.setPixels(mask.fImage);
+ bm.installPixels(info, mask.fImage, dstRB);
}
sk_bzero(bm.getPixels(), bm.getSafeSize());
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidationUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698