aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-07-12 11:38:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-12 19:19:28 +0000
commit9e229233a67b36a508d3c753a5b93a022369c5f7 (patch)
tree25f86e467bc48d5dff3276427f3f1772e8f89352 /tests
parentd46f0091afdc2563ec50319c4f93d110e0868fb9 (diff)
update SkColor4f::FromColor() to preserve transfer function
This kills off some sRGB tables, and lots of call sites can now use SkColor4f::FromColor(). It doesn't seem important to keep this test. Change-Id: Ia79ec8ace45e80bbc7a1e33f560f59289e61b2fb Reviewed-on: https://skia-review.googlesource.com/141046 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SRGBTest.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/SRGBTest.cpp b/tests/SRGBTest.cpp
index 44daeda34a..cf8aaa120b 100644
--- a/tests/SRGBTest.cpp
+++ b/tests/SRGBTest.cpp
@@ -13,34 +13,6 @@
#include <math.h>
#include "../src/jumper/SkJumper.h"
-static uint8_t linear_to_srgb(float l) {
- return (uint8_t)sk_linear_to_srgb(Sk4f{l})[0];
-}
-
-DEF_TEST(sk_linear_to_srgb, r) {
- // All bytes should round trip.
- for (int i = 0; i < 256; i++) {
- int actual = linear_to_srgb(sk_linear_from_srgb[i]);
- if (i != actual) {
- ERRORF(r, "%d -> %d\n", i, actual);
- }
- }
-
- // Should be monotonic between 0 and 1.
- uint8_t prev = 0;
- for (float f = FLT_MIN; f <= 1.0f; ) { // We don't bother checking denorm values.
- uint8_t srgb = linear_to_srgb(f);
-
- REPORTER_ASSERT(r, srgb >= prev);
- prev = srgb;
-
- union { float flt; uint32_t bits; } pun = { f };
- pun.bits++;
- SkDEBUGCODE(pun.bits += 127);
- f = pun.flt;
- }
-}
-
DEF_TEST(sk_pipeline_srgb_roundtrip, r) {
uint32_t reds[256];
for (int i = 0; i < 256; i++) {