Index: gm/lcdoverlap.cpp |
diff --git a/gm/lcdoverlap.cpp b/gm/lcdoverlap.cpp |
index 623d74622d4d938d9b87476b2e973519ff35ad34..380878539f3adedcd4dea1895740c8200066723e 100644 |
--- a/gm/lcdoverlap.cpp |
+++ b/gm/lcdoverlap.cpp |
@@ -49,8 +49,8 @@ protected: |
SkISize onISize() override { return SkISize::Make(kWidth, kHeight); } |
- void drawTestCase(SkCanvas* canvas, SkScalar x, SkScalar y, SkXfermode::Mode mode, |
- SkXfermode::Mode mode2) { |
+ void drawTestCase(SkCanvas* canvas, SkScalar x, SkScalar y, SkBlendMode mode, |
+ SkBlendMode mode2) { |
const SkColor colors[] { |
SK_ColorRED, |
SK_ColorGREEN, |
@@ -60,8 +60,6 @@ protected: |
SK_ColorMAGENTA, |
}; |
- sk_sp<SkXfermode> xfermode(SkXfermode::Make(mode)); |
- sk_sp<SkXfermode> xfermode2(SkXfermode::Make(mode2)); |
for (size_t i = 0; i < SK_ARRAY_COUNT(colors); i++) { |
canvas->save(); |
canvas->translate(x, y); |
@@ -70,7 +68,7 @@ protected: |
SkPaint textPaint; |
textPaint.setColor(colors[i]); |
- textPaint.setXfermode(i % 2 == 0 ? xfermode : xfermode2); |
+ textPaint.setBlendMode(i % 2 == 0 ? mode : mode2); |
canvas->drawTextBlob(fBlob, 0, 0, textPaint); |
canvas->restore(); |
} |
@@ -79,13 +77,11 @@ protected: |
void onDraw(SkCanvas* canvas) override { |
SkScalar offsetX = kWidth / 4.0f; |
SkScalar offsetY = kHeight / 4.0f; |
- drawTestCase(canvas, offsetX, offsetY, SkXfermode::kSrc_Mode, SkXfermode::kSrc_Mode); |
- drawTestCase(canvas, 3 * offsetX, offsetY, SkXfermode::kSrcOver_Mode, |
- SkXfermode::kSrcOver_Mode); |
- drawTestCase(canvas, offsetX, 3 * offsetY, SkXfermode::kHardLight_Mode, |
- SkXfermode::kLuminosity_Mode); |
- drawTestCase(canvas, 3 * offsetX, 3 * offsetY, SkXfermode::kSrcOver_Mode, |
- SkXfermode::kSrc_Mode); |
+ drawTestCase(canvas, offsetX, offsetY, SkBlendMode::kSrc, SkBlendMode::kSrc); |
+ drawTestCase(canvas, 3 * offsetX, offsetY, SkBlendMode::kSrcOver, SkBlendMode::kSrcOver); |
+ drawTestCase(canvas, offsetX, 3 * offsetY, SkBlendMode::kHardLight, |
+ SkBlendMode::kLuminosity); |
+ drawTestCase(canvas, 3 * offsetX, 3 * offsetY, SkBlendMode::kSrcOver, SkBlendMode::kSrc); |
} |
private: |