Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit c245574ba3d0e2ade6c94b2812de3baa383bf4c4.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2396953002
TBR=
Review-Url: https://codereview.chromium.org/2396953002
diff --git a/tests/LayerDrawLooperTest.cpp b/tests/LayerDrawLooperTest.cpp
index 8ba290f..4897fd2 100644
--- a/tests/LayerDrawLooperTest.cpp
+++ b/tests/LayerDrawLooperTest.cpp
@@ -53,7 +53,7 @@
layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looperBuilder.addLayer(layerInfo);
- layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
+ layerPaint->setBlendMode(SkBlendMode::kSrc);
FakeDevice device;
SkCanvas canvas(&device);
@@ -65,7 +65,7 @@
// The back layer should come first.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrc);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());
@@ -73,7 +73,7 @@
// Then the front layer.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrcOver);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
@@ -93,7 +93,7 @@
layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looperBuilder.addLayerOnTop(layerInfo);
- layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
+ layerPaint->setBlendMode(SkBlendMode::kSrc);
FakeDevice device;
SkCanvas canvas(&device);
@@ -105,7 +105,7 @@
// The back layer should come first.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrcOver);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
@@ -113,7 +113,7 @@
// Then the front layer.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrc);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());
@@ -133,7 +133,7 @@
layerInfo.fOffset.set(10.0f, 20.0f);
layerInfo.fPaintBits |= SkLayerDrawLooper::kXfermode_Bit;
SkPaint* layerPaint = looperBuilder.addLayerOnTop(layerInfo);
- layerPaint->setXfermodeMode(SkXfermode::kSrc_Mode);
+ layerPaint->setBlendMode(SkBlendMode::kSrc);
FakeDevice device;
SkCanvas canvas(&device);
@@ -145,7 +145,7 @@
// The back layer should come first.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrcOver);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 0.0f == device.fLastMatrix.getTranslateY());
@@ -153,7 +153,7 @@
// Then the front layer.
REPORTER_ASSERT(reporter, context->next(&canvas, &paint));
- REPORTER_ASSERT(reporter, SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrc_Mode));
+ REPORTER_ASSERT(reporter, paint.getBlendMode() == SkBlendMode::kSrc);
canvas.drawRect(SkRect::MakeWH(50.0f, 50.0f), paint);
REPORTER_ASSERT(reporter, 10.0f == device.fLastMatrix.getTranslateX());
REPORTER_ASSERT(reporter, 20.0f == device.fLastMatrix.getTranslateY());