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

Unified Diff: gm/texteffects.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/textbloblooper.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texteffects.cpp
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp
index 6a5a9c1fb0ef188cd9026d7caa618b5aa62a1962..453a555a6f6bd40abf430aa1184c017b82456eba 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -25,7 +25,7 @@ static void r0(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
p.setAlpha(0x11);
p.setStyle(SkPaint::kFill_Style);
- p.setXfermodeMode(SkXfermode::kSrc_Mode);
+ p.setBlendMode(SkBlendMode::kSrc);
rastBuilder->addLayer(p);
}
@@ -33,7 +33,7 @@ static void r1(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
rastBuilder->addLayer(p);
p.setAlpha(0x40);
- p.setXfermodeMode(SkXfermode::kSrc_Mode);
+ p.setBlendMode(SkBlendMode::kSrc);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1*2);
rastBuilder->addLayer(p);
@@ -46,7 +46,7 @@ static void r2(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1*3/2);
- p.setXfermodeMode(SkXfermode::kClear_Mode);
+ p.setBlendMode(SkBlendMode::kClear);
rastBuilder->addLayer(p);
}
@@ -57,7 +57,7 @@ static void r3(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
p.setAlpha(0x20);
p.setStyle(SkPaint::kFill_Style);
- p.setXfermodeMode(SkXfermode::kSrc_Mode);
+ p.setBlendMode(SkBlendMode::kSrc);
rastBuilder->addLayer(p);
}
@@ -66,10 +66,10 @@ static void r4(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
rastBuilder->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
p.setAlpha(0xFF);
- p.setXfermodeMode(SkXfermode::kClear_Mode);
+ p.setBlendMode(SkBlendMode::kClear);
rastBuilder->addLayer(p, SK_Scalar1*3/2, SK_Scalar1*3/2);
- p.setXfermode(nullptr);
+ p.setBlendMode(SkBlendMode::kSrcOver);
rastBuilder->addLayer(p);
}
@@ -79,7 +79,7 @@ static void r5(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
rastBuilder->addLayer(p);
p.setPathEffect(SkDiscretePathEffect::Make(SK_Scalar1*4, SK_Scalar1*3));
- p.setXfermodeMode(SkXfermode::kSrcOut_Mode);
+ p.setBlendMode(SkBlendMode::kSrcOut);
rastBuilder->addLayer(p);
}
@@ -90,7 +90,7 @@ static void r6(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
SkLayerRasterizer::Builder rastBuilder2;
r5(&rastBuilder2, p);
p.setRasterizer(rastBuilder2.detach());
- p.setXfermodeMode(SkXfermode::kClear_Mode);
+ p.setBlendMode(SkBlendMode::kClear);
rastBuilder->addLayer(p);
}
@@ -117,11 +117,11 @@ static void r8(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
p.setPathEffect(MakeDotEffect(SK_Scalar1*2, lattice));
- p.setXfermodeMode(SkXfermode::kClear_Mode);
+ p.setBlendMode(SkBlendMode::kClear);
rastBuilder->addLayer(p);
p.setPathEffect(nullptr);
- p.setXfermode(nullptr);
+ p.setBlendMode(SkBlendMode::kSrcOver);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1);
rastBuilder->addLayer(p);
@@ -134,11 +134,11 @@ static void r9(SkLayerRasterizer::Builder* rastBuilder, SkPaint& p) {
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
lattice.postRotate(SkIntToScalar(30), 0, 0);
p.setPathEffect(SkLine2DPathEffect::Make(SK_Scalar1*2, lattice));
- p.setXfermodeMode(SkXfermode::kClear_Mode);
+ p.setBlendMode(SkBlendMode::kClear);
rastBuilder->addLayer(p);
p.setPathEffect(nullptr);
- p.setXfermode(nullptr);
+ p.setBlendMode(SkBlendMode::kSrcOver);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1);
rastBuilder->addLayer(p);
« no previous file with comments | « gm/textbloblooper.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698