aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkNxTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2015-06-15 10:03:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-15 10:03:41 -0700
commitb1bbca80492dc71f4a2c026a78d00d6f084c7e47 (patch)
treea84f5fa242fb37d90c49712fa0abd98a0cbd1ca9 /tests/SkNxTest.cpp
parentda5469d7bc0dc089d098f5a64a818ed079cc0930 (diff)
Revert of Thorough tests for saturatedAdd and mulDiv255Round. (patchset #1 id:1 of https://codereview.chromium.org/1184113003/)
Reason for revert: https://code.google.com/p/skia/issues/detail?id=3951 Original issue's description: > Thorough tests for saturatedAdd and mulDiv255Round. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/ce9d11189a5924b47c3629063b72bae9d466c2c7 TBR=fmalita@chromium.org,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1177123004
Diffstat (limited to 'tests/SkNxTest.cpp')
-rw-r--r--tests/SkNxTest.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index eab625d41e..2463b46f08 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-#include "Sk4px.h"
#include "SkNx.h"
#include "SkRandom.h"
#include "Test.h"
@@ -155,38 +154,3 @@ DEF_TEST(SkNi_min, r) {
}}
#endif
}
-
-DEF_TEST(SkNi_saturatedAdd, r) {
- for (int a = 0; a < (1<<8); a++) {
- for (int b = 0; b < (1<<8); b++) {
- int exact = a+b;
- if (exact > 255) { exact = 255; }
- if (exact < 0) { exact = 0; }
-
- REPORTER_ASSERT(r, Sk16b(a).saturatedAdd(Sk16b(b)).kth<0>() == exact);
- }
- }
-}
-
-DEF_TEST(Sk4px_muldiv255round, r) {
- for (int a = 0; a < (1<<8); a++) {
- for (int b = 0; b < (1<<8); b++) {
- int exact = (a*b+127)/255;
-
- // Duplicate a and b 16x each.
- Sk4px av((SkAlpha)a),
- bv((SkAlpha)b);
-
- // This way should always be exactly correct.
- int correct = av.mulWiden(bv).div255RoundNarrow().kth<0>();
- REPORTER_ASSERT(r, correct == exact);
-
- // We're a bit more flexible on this method: correct for 0 or 255, otherwise off by <=1.
- int fast = av.fastMulDiv255Round(bv).kth<0>();
- REPORTER_ASSERT(r, fast-exact >= -1 && fast-exact <= 1);
- if (a == 0 || a == 255 || b == 0 || b == 255) {
- REPORTER_ASSERT(r, fast == exact);
- }
- }
- }
-}