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

Unified Diff: gm/imagefilterscropexpand.cpp

Issue 1978363002: Image filters: fix filtering of transparent black in CFIF. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix upstream for rietveld Created 4 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 | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilterscropexpand.cpp
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index 4ce845d9eea06ff1f6ce831a72b038a698f55873..9b9f7ee81743e91dd8e6a434ac2103902a85478c 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -50,11 +50,13 @@ protected:
sk_sp<SkImageFilter> gradientCircleSource(SkImageSource::Make(std::move(gradientCircle)));
sk_sp<SkImageFilter> noopCropped(SkOffsetImageFilter::Make(0, 0, nullptr, &cropRect));
- SkScalar sk255 = SkIntToScalar(255);
+ // This color matrix saturates the green component but only partly increases the opacity.
+ // For the opaque checkerboard, the opacity boost doesn't matter but it does impact the
+ // area outside the checkerboard.
SkScalar matrix[20] = { 1, 0, 0, 0, 0,
- 0, 1, 0, 0, sk255,
+ 0, 1, 0, 0, 255,
0, 0, 1, 0, 0,
- 0, 0, 0, 0, sk255 };
+ 0, 0, 0, 1, 32 };
sk_sp<SkColorFilter> cfAlphaTrans(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698