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

Unified Diff: tests/PaintTest.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/PDFOpaqueSrcModeToSrcOverTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PaintTest.cpp
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index f50746777149f68f2aef5517a2de9976e8e450eb..c4a4fb7721635585ebefc59867755f8b5828e682 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -292,7 +292,7 @@ DEF_TEST(Paint_MoreFlattening, r) {
paint.setColor(0x00AABBCC);
paint.setTextScaleX(1.0f); // Default value, ignored.
paint.setTextSize(19);
- paint.setXfermode(SkXfermode::Make(SkXfermode::kModulate_Mode));
+ paint.setBlendMode(SkBlendMode::kModulate);
paint.setLooper(nullptr); // Default value, ignored.
SkBinaryWriteBuffer writer;
@@ -311,12 +311,11 @@ DEF_TEST(Paint_MoreFlattening, r) {
ASSERT(other.getTextScaleX() == paint.getTextScaleX());
ASSERT(other.getTextSize() == paint.getTextSize());
ASSERT(other.getLooper() == paint.getLooper());
+ ASSERT(other.getBlendMode() == paint.getBlendMode());
- // We have to be a little looser and compare just the modes. Pointers might not be the same.
- SkXfermode::Mode otherMode, paintMode;
- ASSERT(other.getXfermode()->asMode(&otherMode));
- ASSERT(paint.getXfermode()->asMode(&paintMode));
- ASSERT(otherMode == paintMode);
+#ifdef SK_SUPPORT_LEGACY_XFERMODE_PTR
+ other.setXfermode(nullptr);
+#endif
}
DEF_TEST(Paint_getHash, r) {
@@ -355,11 +354,11 @@ DEF_TEST(Paint_nothingToDraw, r) {
REPORTER_ASSERT(r, paint.nothingToDraw());
paint.setAlpha(0xFF);
- paint.setXfermodeMode(SkXfermode::kDst_Mode);
+ paint.setBlendMode(SkBlendMode::kDst);
REPORTER_ASSERT(r, paint.nothingToDraw());
paint.setAlpha(0);
- paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
+ paint.setBlendMode(SkBlendMode::kSrcOver);
SkColorMatrix cm;
cm.setIdentity(); // does not change alpha
« no previous file with comments | « tests/PDFOpaqueSrcModeToSrcOverTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698