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

Unified Diff: tests/PDFOpaqueSrcModeToSrcOverTest.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/LayerDrawLooperTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PDFOpaqueSrcModeToSrcOverTest.cpp
diff --git a/tests/PDFOpaqueSrcModeToSrcOverTest.cpp b/tests/PDFOpaqueSrcModeToSrcOverTest.cpp
index 76796f5500bd84e38c6ca7679473a64871fb113a..e15234d0905e667ad7b959b6caab6094152f334d 100644
--- a/tests/PDFOpaqueSrcModeToSrcOverTest.cpp
+++ b/tests/PDFOpaqueSrcModeToSrcOverTest.cpp
@@ -9,14 +9,14 @@
#include "SkStream.h"
#include "Test.h"
-static void run_test(SkWStream* out, SkXfermode::Mode mode, U8CPU alpha) {
+static void run_test(SkWStream* out, SkBlendMode mode, U8CPU alpha) {
sk_sp<SkDocument> pdfDoc(SkDocument::MakePDF(out));
SkCanvas* c = pdfDoc->beginPage(612.0f, 792.0f);
SkPaint black;
SkPaint background;
background.setColor(SK_ColorWHITE);
background.setAlpha(alpha);
- background.setXfermodeMode(mode);
+ background.setBlendMode(mode);
c->drawRect(SkRect::MakeWH(612.0f, 792.0f), background);
c->drawRect(SkRect::MakeXYWH(36.0f, 36.0f, 9.0f, 9.0f), black);
c->drawRect(SkRect::MakeXYWH(72.0f, 72.0f, 468.0f, 648.0f), background);
@@ -31,8 +31,8 @@ DEF_TEST(SkPDF_OpaqueSrcModeToSrcOver, r) {
SkDynamicMemoryWStream srcOverMode;
U8CPU alpha = SK_AlphaOPAQUE;
- run_test(&srcMode, SkXfermode::kSrc_Mode, alpha);
- run_test(&srcOverMode, SkXfermode::kSrcOver_Mode, alpha);
+ run_test(&srcMode, SkBlendMode::kSrc, alpha);
+ run_test(&srcOverMode, SkBlendMode::kSrcOver, alpha);
REPORTER_ASSERT(r, srcMode.getOffset() == srcOverMode.getOffset());
// The two PDFs should be equal because they have an opaque alpha.
@@ -40,8 +40,8 @@ DEF_TEST(SkPDF_OpaqueSrcModeToSrcOver, r) {
srcOverMode.reset();
alpha = 0x80;
- run_test(&srcMode, SkXfermode::kSrc_Mode, alpha);
- run_test(&srcOverMode, SkXfermode::kSrcOver_Mode, alpha);
+ run_test(&srcMode, SkBlendMode::kSrc, alpha);
+ run_test(&srcOverMode, SkBlendMode::kSrcOver, alpha);
REPORTER_ASSERT(r, srcMode.getOffset() > srcOverMode.getOffset());
// The two PDFs should not be equal because they have a non-opaque alpha.
}
« no previous file with comments | « tests/LayerDrawLooperTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698