diff options
author | mtklein <mtklein@chromium.org> | 2016-01-22 07:42:53 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-22 07:42:53 -0800 |
commit | 8bf7b79cf9776b4edb3f6810e5ab8c80c49d3480 (patch) | |
tree | 65f114dce236fffbbc0e4605a6f1223523281e41 /tests | |
parent | 6c9cd55f00beeba3ded3f28bcbdd6ef030c4dac7 (diff) |
Refactor swizzle names and types.
- Plant a flag to say "pretend all the inputs are RGBA".
This is how libpng thinks.
This is the opposite of what the implementation had been doing,
so I've rearranged everything to reflect the new orientation.
- Rewrite the names to be less mysterious looking. No more Xs.
- Make the src type uniformly const void*, to allow for 888 (RGB) srcs.
This should be performance and pixel neutral. (Please revert if it's not.)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1626463002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review URL: https://codereview.chromium.org/1626463002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SwizzlerTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/SwizzlerTest.cpp b/tests/SwizzlerTest.cpp index f67cfeef7a..e1626d52f1 100644 --- a/tests/SwizzlerTest.cpp +++ b/tests/SwizzlerTest.cpp @@ -132,28 +132,28 @@ DEF_TEST(SwizzleOpts, r) { // forall c, c*255 == c, c*0 == 0 for (int c = 0; c <= 255; c++) { src = (255<<24) | c; - SkOpts::premul_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_rgbA(&dst, &src, 1); REPORTER_ASSERT(r, dst == src); - SkOpts::premul_swaprb_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_bgrA(&dst, &src, 1); REPORTER_ASSERT(r, dst == (uint32_t)((255<<24) | (c<<16))); src = (0<<24) | c; - SkOpts::premul_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_rgbA(&dst, &src, 1); REPORTER_ASSERT(r, dst == 0); - SkOpts::premul_swaprb_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_bgrA(&dst, &src, 1); REPORTER_ASSERT(r, dst == 0); } // check a totally arbitrary color src = 0xFACEB004; - SkOpts::premul_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_rgbA(&dst, &src, 1); REPORTER_ASSERT(r, dst == 0xFACAAD04); // swap red and blue - SkOpts::swaprb_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_BGRA(&dst, &src, 1); REPORTER_ASSERT(r, dst == 0xFA04B0CE); // all together now - SkOpts::premul_swaprb_xxxa(&dst, &src, 1); + SkOpts::RGBA_to_bgrA(&dst, &src, 1); REPORTER_ASSERT(r, dst == 0xFA04ADCA); } |