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

Unified Diff: tests/LayerDrawLooperTest.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 | « tests/ImageTest.cpp ('k') | tests/PDFOpaqueSrcModeToSrcOverTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/LayerDrawLooperTest.cpp
diff --git a/tests/LayerDrawLooperTest.cpp b/tests/LayerDrawLooperTest.cpp
index 8ba290fbdf2184843945f1e1519d549e50057268..4897fd28844fad377744fd95af3391e72d76ab7c 100644
--- a/tests/LayerDrawLooperTest.cpp
+++ b/tests/LayerDrawLooperTest.cpp
@@ -53,7 +53,7 @@ static void test_frontToBack(skiatest::Reporter* reporter) {
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 @@ static void test_frontToBack(skiatest::Reporter* reporter) {
// 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 @@ static void test_frontToBack(skiatest::Reporter* reporter) {
// 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 @@ static void test_backToFront(skiatest::Reporter* reporter) {
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 @@ static void test_backToFront(skiatest::Reporter* reporter) {
// 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 @@ static void test_backToFront(skiatest::Reporter* reporter) {
// 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 @@ static void test_mixed(skiatest::Reporter* reporter) {
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 @@ static void test_mixed(skiatest::Reporter* reporter) {
// 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 @@ static void test_mixed(skiatest::Reporter* reporter) {
// 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());
« no previous file with comments | « tests/ImageTest.cpp ('k') | tests/PDFOpaqueSrcModeToSrcOverTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698