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

Unified Diff: src/core/SkDraw.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/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 5692fe11b319c7cbe1177aa38afeffbe982fa2e4..fa2ac9863e4590e566f27485cd01ec510045b026 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1216,9 +1216,8 @@ void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
// now draw our bitmap(src) into mask(dst), transformed by the matrix
{
SkBitmap device;
- device.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(),
- mask.fBounds.height(), mask.fRowBytes);
- device.setPixels(mask.fImage);
+ device.installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), mask.fBounds.height()),
+ mask.fImage, mask.fRowBytes);
SkCanvas c(device);
// need the unclipped top/left for the translate
@@ -1666,9 +1665,8 @@ void SkDraw1Glyph::blitMaskAsSprite(const SkMask& mask) const {
SkASSERT(SkMask::kARGB32_Format == mask.fFormat);
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config,
- mask.fBounds.width(), mask.fBounds.height(), mask.fRowBytes);
- bm.setPixels((SkPMColor*)mask.fImage);
+ bm.installPixels(SkImageInfo::MakeN32Premul(mask.fBounds.width(), mask.fBounds.height()),
+ (SkPMColor*)mask.fImage, mask.fRowBytes);
fDraw->drawSprite(bm, mask.fBounds.x(), mask.fBounds.y(), *fPaint);
}
@@ -2673,8 +2671,8 @@ static void draw_into_mask(const SkMask& mask, const SkPath& devPath,
SkMatrix matrix;
SkPaint paint;
- bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), mask.fBounds.height(), mask.fRowBytes);
- bm.setPixels(mask.fImage);
+ bm.installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), mask.fBounds.height()),
+ mask.fImage, mask.fRowBytes);
clip.setRect(SkIRect::MakeWH(mask.fBounds.width(), mask.fBounds.height()));
matrix.setTranslate(-SkIntToScalar(mask.fBounds.fLeft),
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698