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

Unified Diff: tests/SkNxTest.cpp

Issue 1230663005: 3-15% speedup to HardLight / Overlay xfermodes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add a test that widenLo() | widenHi() == widenLoHi() Created 5 years, 5 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 | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkNxTest.cpp
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 58932148cb5a6bee16dff65d94bb85c1ad74726f..4005d2518f5684a4b782a097cd01579afb58751b 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -192,3 +192,19 @@ DEF_TEST(Sk4px_muldiv255round, r) {
}
}
}
+
+DEF_TEST(Sk4px_widening, r) {
+ SkPMColor colors[] = {
+ SkPreMultiplyColor(0xff00ff00),
+ SkPreMultiplyColor(0x40008000),
+ SkPreMultiplyColor(0x7f020406),
+ SkPreMultiplyColor(0x00000000),
+ };
+ auto packed = Sk4px::Load4(colors);
+
+ auto wideLo = packed.widenLo(),
+ wideHi = packed.widenHi(),
+ wideLoHi = packed.widenLoHi(),
+ wideLoHiAlt = wideLo + wideHi;
+ REPORTER_ASSERT(r, 0 == memcmp(&wideLoHi, &wideLoHiAlt, sizeof(wideLoHi)));
+}
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698