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

Unified Diff: fuzz/FilterFuzz.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « dm/DMSrcSink.cpp ('k') | gm/aaclip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzz/FilterFuzz.cpp
diff --git a/fuzz/FilterFuzz.cpp b/fuzz/FilterFuzz.cpp
index 6b766a2b7c72f65828cc414646c527bf0e12e890..e6f9cb31cbaf8ebf8fd377f1d2f61913eb507b70 100644
--- a/fuzz/FilterFuzz.cpp
+++ b/fuzz/FilterFuzz.cpp
@@ -154,8 +154,8 @@ static SkMatrix make_matrix() {
return m;
}
-static SkXfermode::Mode make_xfermode() {
- return static_cast<SkXfermode::Mode>(R(SkXfermode::kLastMode+1));
+static SkBlendMode make_blendmode() {
+ return static_cast<SkBlendMode>(R((int)SkBlendMode::kLastMode+1));
}
static SkPaint::Align make_paint_align() {
@@ -369,7 +369,7 @@ static sk_sp<SkColorFilter> make_color_filter() {
return SkTableColorFilter::MakeARGB(tableA, tableR, tableG, tableB);
}
case 3:
- return SkColorFilter::MakeModeFilter(make_color(), make_xfermode());
+ return SkColorFilter::MakeModeFilter(make_color(), (SkXfermode::Mode)make_blendmode());
case 4:
return SkColorMatrixFilter::MakeLightingFilter(make_color(), make_color());
case 5:
@@ -505,7 +505,7 @@ static SkPaint make_paint() {
paint.setStrokeCap(make_paint_cap());
paint.setStrokeJoin(make_paint_join());
paint.setColorFilter(make_color_filter());
- paint.setXfermodeMode(make_xfermode());
+ paint.setBlendMode(make_blendmode());
paint.setPathEffect(make_path_effect());
paint.setMaskFilter(make_mask_filter());
@@ -540,7 +540,7 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
}
enum { ALPHA_THRESHOLD, MERGE, COLOR, LUT3D, BLUR, MAGNIFIER,
- XFERMODE, OFFSET, MATRIX, MATRIX_CONVOLUTION, COMPOSE,
+ BLENDMODE, OFFSET, MATRIX, MATRIX_CONVOLUTION, COMPOSE,
DISTANT_LIGHT, POINT_LIGHT, SPOT_LIGHT, NOISE, DROP_SHADOW,
MORPHOLOGY, BITMAP, DISPLACE, TILE, PICTURE, PAINT, NUM_FILTERS };
@@ -554,7 +554,7 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
case MERGE:
filter = SkMergeImageFilter::Make(make_image_filter(),
make_image_filter(),
- make_xfermode());
+ (SkXfermode::Mode)make_blendmode());
break;
case COLOR: {
sk_sp<SkColorFilter> cf(make_color_filter());
@@ -580,8 +580,8 @@ static sk_sp<SkImageFilter> make_image_filter(bool canBeNull) {
make_scalar(true),
make_image_filter());
break;
- case XFERMODE:
- filter = SkXfermodeImageFilter::Make(SkXfermode::Make(make_xfermode()),
+ case BLENDMODE:
+ filter = SkXfermodeImageFilter::Make(make_blendmode(),
make_image_filter(),
make_image_filter(),
nullptr);
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | gm/aaclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698