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

Unified Diff: gm/lcdblendmodes.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/imagefilterstransformed.cpp ('k') | gm/lcdoverlap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lcdblendmodes.cpp
diff --git a/gm/lcdblendmodes.cpp b/gm/lcdblendmodes.cpp
index 537c4cbda3443ae9de5608c3ccdeb162ffa956ae..a16e219c6b242a4b8929cc9dcc6692d42c03b9fb 100644
--- a/gm/lcdblendmodes.cpp
+++ b/gm/lcdblendmodes.cpp
@@ -76,44 +76,44 @@ protected:
this->drawColumn(surfCanvas, SK_ColorCYAN, SK_ColorMAGENTA, true);
SkPaint surfPaint;
- surfPaint.setXfermode(SkXfermode::Make(SkXfermode::kSrcOver_Mode));
+ surfPaint.setBlendMode(SkBlendMode::kSrcOver);
surface->draw(canvas, 0, 0, &surfPaint);
}
void drawColumn(SkCanvas* canvas, SkColor backgroundColor, SkColor textColor, bool useGrad) {
const struct {
- SkXfermode::Mode fMode;
- const char* fLabel;
+ SkBlendMode fMode;
+ const char* fLabel;
} gModes[] = {
- { SkXfermode::kClear_Mode, "Clear" },
- { SkXfermode::kSrc_Mode, "Src" },
- { SkXfermode::kDst_Mode, "Dst" },
- { SkXfermode::kSrcOver_Mode, "SrcOver" },
- { SkXfermode::kDstOver_Mode, "DstOver" },
- { SkXfermode::kSrcIn_Mode, "SrcIn" },
- { SkXfermode::kDstIn_Mode, "DstIn" },
- { SkXfermode::kSrcOut_Mode, "SrcOut" },
- { SkXfermode::kDstOut_Mode, "DstOut" },
- { SkXfermode::kSrcATop_Mode, "SrcATop" },
- { SkXfermode::kDstATop_Mode, "DstATop" },
- { SkXfermode::kXor_Mode, "Xor" },
- { SkXfermode::kPlus_Mode, "Plus" },
- { SkXfermode::kModulate_Mode, "Modulate" },
- { SkXfermode::kScreen_Mode, "Screen" },
- { SkXfermode::kOverlay_Mode, "Overlay" },
- { SkXfermode::kDarken_Mode, "Darken" },
- { SkXfermode::kLighten_Mode, "Lighten" },
- { SkXfermode::kColorDodge_Mode, "ColorDodge" },
- { SkXfermode::kColorBurn_Mode, "ColorBurn" },
- { SkXfermode::kHardLight_Mode, "HardLight" },
- { SkXfermode::kSoftLight_Mode, "SoftLight" },
- { SkXfermode::kDifference_Mode, "Difference" },
- { SkXfermode::kExclusion_Mode, "Exclusion" },
- { SkXfermode::kMultiply_Mode, "Multiply" },
- { SkXfermode::kHue_Mode, "Hue" },
- { SkXfermode::kSaturation_Mode, "Saturation" },
- { SkXfermode::kColor_Mode, "Color" },
- { SkXfermode::kLuminosity_Mode, "Luminosity" },
+ { SkBlendMode::kClear, "Clear" },
+ { SkBlendMode::kSrc, "Src" },
+ { SkBlendMode::kDst, "Dst" },
+ { SkBlendMode::kSrcOver, "SrcOver" },
+ { SkBlendMode::kDstOver, "DstOver" },
+ { SkBlendMode::kSrcIn, "SrcIn" },
+ { SkBlendMode::kDstIn, "DstIn" },
+ { SkBlendMode::kSrcOut, "SrcOut" },
+ { SkBlendMode::kDstOut, "DstOut" },
+ { SkBlendMode::kSrcATop, "SrcATop" },
+ { SkBlendMode::kDstATop, "DstATop" },
+ { SkBlendMode::kXor, "Xor" },
+ { SkBlendMode::kPlus, "Plus" },
+ { SkBlendMode::kModulate, "Modulate" },
+ { SkBlendMode::kScreen, "Screen" },
+ { SkBlendMode::kOverlay, "Overlay" },
+ { SkBlendMode::kDarken, "Darken" },
+ { SkBlendMode::kLighten, "Lighten" },
+ { SkBlendMode::kColorDodge, "ColorDodge" },
+ { SkBlendMode::kColorBurn, "ColorBurn" },
+ { SkBlendMode::kHardLight, "HardLight" },
+ { SkBlendMode::kSoftLight, "SoftLight" },
+ { SkBlendMode::kDifference, "Difference" },
+ { SkBlendMode::kExclusion, "Exclusion" },
+ { SkBlendMode::kMultiply, "Multiply" },
+ { SkBlendMode::kHue, "Hue" },
+ { SkBlendMode::kSaturation, "Saturation" },
+ { SkBlendMode::kColor, "Color" },
+ { SkBlendMode::kLuminosity, "Luminosity" },
};
// Draw background rect
SkPaint backgroundPaint;
@@ -128,7 +128,7 @@ protected:
paint.setSubpixelText(true);
paint.setLCDRenderText(true);
paint.setTextSize(fTextHeight);
- paint.setXfermode(SkXfermode::Make(gModes[m].fMode));
+ paint.setBlendMode(gModes[m].fMode);
sk_tool_utils::set_portable_typeface(&paint);
if (useGrad) {
SkRect r;
« no previous file with comments | « gm/imagefilterstransformed.cpp ('k') | gm/lcdoverlap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698