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

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 168843002: use SkColorType instead of SkBitmap::Config in views/effects (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 21731c4a31fb6ee79dfbe5832d6bbca730bc0d71..f4d399b80fef48b27f99a273112db77fb723909b 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -195,10 +195,9 @@ static bool draw_rrect_into_mask(const SkRRect rrect, SkMask* mask) {
// FIXME: This code duplicates code in draw_rects_into_mask, below. Is there a
// clean way to share more code?
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kA8_Config,
- mask->fBounds.width(), mask->fBounds.height(),
- mask->fRowBytes);
- bitmap.setPixels(mask->fImage);
+ bitmap.installPixels(SkImageInfo::MakeA8(mask->fBounds.width(),
+ mask->fBounds.height()),
+ mask->fImage, mask->fRowBytes, NULL, NULL);
SkCanvas canvas(bitmap);
canvas.translate(-SkIntToScalar(mask->fBounds.left()),
@@ -216,10 +215,11 @@ static bool draw_rects_into_mask(const SkRect rects[], int count, SkMask* mask)
}
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kA8_Config,
- mask->fBounds.width(), mask->fBounds.height(),
- mask->fRowBytes);
- bitmap.setPixels(mask->fImage);
+ bitmap.installPixels(SkImageInfo::Make(mask->fBounds.width(),
+ mask->fBounds.height(),
+ kAlpha_8_SkColorType,
+ kPremul_SkAlphaType),
+ mask->fImage, mask->fRowBytes, NULL, NULL);
SkCanvas canvas(bitmap);
canvas.translate(-SkIntToScalar(mask->fBounds.left()),
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698