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

Unified Diff: src/core/SkScalerContext.cpp

Issue 302053002: Revert of setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 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());
« 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