diff options
author | Mike Reed <reed@google.com> | 2016-11-15 16:44:34 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-16 15:38:11 +0000 |
commit | d47067392848ba132d4e86ffbeebe2dcacda9534 (patch) | |
tree | 456bd4182524d55f19117d8e726bacca50059fa8 /tests/BlendTest.cpp | |
parent | 988283c89458442f65d961f2746a9f271a39c31e (diff) |
make SkXfermode.h go away
This is step one:
- make SkXfermode useless to public clients
- everything they should need is in SkBlendMode.h
Step two:
- remove SkXfermode.h entirely (since skia core will already be using SkXfermodePriv.h)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4534
Change-Id: If2cea9f71df92430ed6644edb98dd306c5572cbc
Reviewed-on: https://skia-review.googlesource.com/4534
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tests/BlendTest.cpp')
-rw-r--r-- | tests/BlendTest.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp index ca9e46efd3..cd5e8efba7 100644 --- a/tests/BlendTest.cpp +++ b/tests/BlendTest.cpp @@ -67,36 +67,3 @@ DEF_TEST(Blend_byte_multiply, r) { }; for (auto multiply : perfect) { REPORTER_ASSERT(r, test(multiply).diffs == 0); } } - -DEF_TEST(Blend_premul_begets_premul, r) { - // This test is quite slow, even if you have enough cores to run each mode in parallel. - if (!r->allowExtendedTest()) { - return; - } - - // No matter what xfermode we use, premul inputs should create premul outputs. - auto test_mode = [&](int m) { - SkXfermode::Mode mode = (SkXfermode::Mode)m; - if (mode == SkXfermode::kSrcOver_Mode) { - return; // TODO: can't create a SrcOver xfermode. - } - auto xfermode(SkXfermode::Make(mode)); - SkASSERT(xfermode); - // We'll test all alphas and legal color values, assuming all colors work the same. - // This is not true for non-separable blend modes, but this test still can't hurt. - for (int sa = 0; sa <= 255; sa++) { - for (int da = 0; da <= 255; da++) { - for (int s = 0; s <= sa; s++) { - for (int d = 0; d <= da; d++) { - SkPMColor src = SkPackARGB32(sa, s, s, s), - dst = SkPackARGB32(da, d, d, d); - xfermode->xfer32(&dst, &src, 1, nullptr); // To keep it simple, no AA. - if (!SkPMColorValid(dst)) { - ERRORF(r, "%08x is not premul using %s", dst, SkXfermode::ModeName(mode)); - } - }}}} - }; - - // Parallelism helps speed things up on my desktop from ~725s to ~50s. - SkTaskGroup().batch(SkXfermode::kLastMode, test_mode); -} |