Index: gm/aarectmodes.cpp |
diff --git a/gm/aarectmodes.cpp b/gm/aarectmodes.cpp |
index 6e9f4bf6001b95295830470e3df5a20e768faf29..ebc47c2da22a97880d84f3c044917113eb829484 100644 |
--- a/gm/aarectmodes.cpp |
+++ b/gm/aarectmodes.cpp |
@@ -59,21 +59,21 @@ static void test4(SkCanvas* canvas) { |
} |
constexpr 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" }, |
+ { 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" }, |
}; |
const int gWidth = 64; |
@@ -81,7 +81,7 @@ const int gHeight = 64; |
const SkScalar W = SkIntToScalar(gWidth); |
const SkScalar H = SkIntToScalar(gHeight); |
-static SkScalar drawCell(SkCanvas* canvas, sk_sp<SkXfermode> mode, SkAlpha a0, SkAlpha a1) { |
+static SkScalar drawCell(SkCanvas* canvas, SkBlendMode mode, SkAlpha a0, SkAlpha a1) { |
SkPaint paint; |
paint.setAntiAlias(true); |
@@ -95,7 +95,7 @@ static SkScalar drawCell(SkCanvas* canvas, sk_sp<SkXfermode> mode, SkAlpha a0, S |
paint.setColor(SK_ColorRED); |
paint.setAlpha(a1); |
- paint.setXfermode(std::move(mode)); |
+ paint.setBlendMode(mode); |
SkScalar offset = SK_Scalar1 / 3; |
SkRect rect = SkRect::MakeXYWH(W / 4 + offset, |
@@ -155,7 +155,7 @@ namespace skiagm { |
} |
canvas->drawRect(bounds, fBGPaint); |
canvas->saveLayer(&bounds, nullptr); |
- SkScalar dy = drawCell(canvas, SkXfermode::Make(gModes[i].fMode), |
+ SkScalar dy = drawCell(canvas, gModes[i].fMode, |
gAlphaValue[alpha & 1], |
gAlphaValue[alpha & 2]); |
canvas->restore(); |