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

Unified Diff: gm/gamma.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/dstreadshuffle.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gamma.cpp
diff --git a/gm/gamma.cpp b/gm/gamma.cpp
index f6b4a9ceeddc55b29e7cac59cc4406676ee298d0..80209e53f866db641c48ba6a7a2c06828a65d0cf 100644
--- a/gm/gamma.cpp
+++ b/gm/gamma.cpp
@@ -75,11 +75,11 @@ DEF_SIMPLE_GM(gamma, canvas, 850, 200) {
advance();
};
- auto nextXferRect = [&](SkColor srcColor, SkXfermode::Mode mode, SkColor dstColor) {
+ auto nextXferRect = [&](SkColor srcColor, SkBlendMode mode, SkColor dstColor) {
p.setColor(dstColor);
canvas->drawRect(r, p);
p.setColor(srcColor);
- p.setXfermodeMode(mode);
+ p.setBlendMode(mode);
canvas->drawRect(r, p);
SkString srcText = SkStringPrintf("%08X", srcColor);
@@ -207,18 +207,18 @@ DEF_SIMPLE_GM(gamma, canvas, 850, 200) {
canvas->saveLayer(nullptr, nullptr);
- nextXferRect(0x7fffffff, SkXfermode::kSrcOver_Mode, SK_ColorBLACK);
- nextXferRect(0x7f000000, SkXfermode::kSrcOver_Mode, SK_ColorWHITE);
+ nextXferRect(0x7fffffff, SkBlendMode::kSrcOver, SK_ColorBLACK);
+ nextXferRect(0x7f000000, SkBlendMode::kSrcOver, SK_ColorWHITE);
- nextXferRect(SK_ColorBLACK, SkXfermode::kDstOver_Mode, 0x7fffffff);
- nextXferRect(SK_ColorWHITE, SkXfermode::kSrcIn_Mode, 0x7fff00ff);
- nextXferRect(0x7fff00ff, SkXfermode::kDstIn_Mode, SK_ColorWHITE);
+ nextXferRect(SK_ColorBLACK, SkBlendMode::kDstOver, 0x7fffffff);
+ nextXferRect(SK_ColorWHITE, SkBlendMode::kSrcIn, 0x7fff00ff);
+ nextXferRect(0x7fff00ff, SkBlendMode::kDstIn, SK_ColorWHITE);
// 0x89 = 255 * linear_to_srgb(0.25)
- nextXferRect(0xff898989, SkXfermode::kPlus_Mode, 0xff898989);
+ nextXferRect(0xff898989, SkBlendMode::kPlus, 0xff898989);
// 0xDB = 255 * linear_to_srgb(sqrt(0.5))
- nextXferRect(0xffdbdbdb, SkXfermode::kModulate_Mode, 0xffdbdbdb);
+ nextXferRect(0xffdbdbdb, SkBlendMode::kModulate, 0xffdbdbdb);
canvas->restore();
}
« no previous file with comments | « gm/dstreadshuffle.cpp ('k') | gm/gm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698