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

Unified Diff: samplecode/SampleAll.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 | « samplecode/SampleAARectModes.cpp ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleAll.cpp
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 29b5c66c7419e7f22481f124b6008f2d03727288..8c1ace564a1c34495789e5e4f18c0de305eaf758 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -89,7 +89,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);
}
@@ -97,7 +97,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);
@@ -110,7 +110,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);
}
@@ -121,7 +121,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);
}
@@ -130,10 +130,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);
}
@@ -141,7 +141,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);
}
@@ -152,7 +152,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);
}
@@ -194,11 +194,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(sk_make_sp<Dot2DPathEffect>(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);
@@ -211,11 +211,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);
@@ -401,10 +401,10 @@ protected:
paint.setColor(SK_ColorGREEN);
paint.setStrokeWidth(SkIntToScalar(10));
paint.setStyle(SkPaint::kStroke_Style);
- paint.setXfermode(SkXfermode::Make(SkXfermode::kXor_Mode));
+ paint.setBlendMode(SkBlendMode::kXor);
paint.setColorFilter(lightingFilter);
canvas->drawLine(start.fX, start.fY, stop.fX, stop.fY, paint); // should not be green
- paint.setXfermode(nullptr);
+ paint.setBlendMode(SkBlendMode::kSrcOver);
paint.setColorFilter(nullptr);
// rectangle
« no previous file with comments | « samplecode/SampleAARectModes.cpp ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698