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: gm/lumafilter.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 | « gm/lcdoverlap.cpp ('k') | gm/modecolorfilters.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lumafilter.cpp
diff --git a/gm/lumafilter.cpp b/gm/lumafilter.cpp
index 10eefabd5642ddc7c382a7bfbfe48e8138120be5..3852d9385f8c62a9b1ad14078698c9c311f29332 100644
--- a/gm/lumafilter.cpp
+++ b/gm/lumafilter.cpp
@@ -26,7 +26,7 @@ static void draw_label(SkCanvas* canvas, const char* label,
paint);
}
-static void draw_scene(SkCanvas* canvas, const sk_sp<SkColorFilter>& filter, SkXfermode::Mode mode,
+static void draw_scene(SkCanvas* canvas, const sk_sp<SkColorFilter>& filter, SkBlendMode mode,
const sk_sp<SkShader>& s1, const sk_sp<SkShader>& s2) {
SkPaint paint;
paint.setAntiAlias(true);
@@ -53,7 +53,7 @@ static void draw_scene(SkCanvas* canvas, const sk_sp<SkColorFilter>& filter, SkX
}
SkPaint xferPaint;
- xferPaint.setXfermodeMode(mode);
+ xferPaint.setBlendMode(mode);
canvas->saveLayer(&bounds, &xferPaint);
r = bounds;
@@ -101,13 +101,14 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- SkXfermode::Mode modes[] = { SkXfermode::kSrcOver_Mode,
- SkXfermode::kDstOver_Mode,
- SkXfermode::kSrcATop_Mode,
- SkXfermode::kDstATop_Mode,
- SkXfermode::kSrcIn_Mode,
- SkXfermode::kDstIn_Mode,
- };
+ SkBlendMode modes[] = {
+ SkBlendMode::kSrcOver,
+ SkBlendMode::kDstOver,
+ SkBlendMode::kSrcATop,
+ SkBlendMode::kDstATop,
+ SkBlendMode::kSrcIn,
+ SkBlendMode::kDstIn,
+ };
struct {
const sk_sp<SkShader>& fShader1;
const sk_sp<SkShader>& fShader2;
« no previous file with comments | « gm/lcdoverlap.cpp ('k') | gm/modecolorfilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698