Skip to content

Commit

Permalink
remove SK_LEGACY_SRGB_STAGE_CHOICE
Browse files Browse the repository at this point in the history
Whenever we linearize or encode sRGB, we use custom fast routines to do
this; other transfer functions go through a slower general case path.

We "recently" realized that the specialized sRGB routines are only
accurate over an input domain of about [-2,2].  This is normally fine,
as the common input domain is normalized values in [0,1], but sometimes
we deal with colors outside a given gamut.  In the limit, a
from_sRGB(to_sRGB(x)) roundtrip asymptotes to 8, not x like you'd want!

So flipping this flag switches us to keep using the fast sRGB math when
we're sure the inputs are normalized, but switch over to the general
case if we even suspect we're not.

Change-Id: Ie604c6d7d3a5d9655ed1af09d832be5ac951b375
Reviewed-on: https://chromium-review.googlesource.com/c/1459397
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630641}
  • Loading branch information
Mike Klein authored and Commit Bot committed Feb 9, 2019
1 parent 32448b3 commit 1b07639
Show file tree
Hide file tree
Showing 278 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions skia/config/SkUserConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
#define SK_SUPPORT_LEGACY_AAA_CHOICE
#endif

#define SK_LEGACY_SRGB_STAGE_CHOICE

// We're turning this off indefinitely,
// until we can figure out some fundamental problems with its approach.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// Narrowing down the source of expected error:
// - Alpha values should always match.
// - Color components should be acceptably close. All tests locally pass
// with a tolerance of 4 (uint8), 0.01 (f16/srgb,p3), and 0.02 (rec2020).
// with a tolerance of 4 (uint8) or 0.02 (f16).
// - The red channel of the green pixel has the largest error since green
// has the largest change in what's representable between sRGB and
// P3/Rec2020. Red channel of the green pixel is R channel of the second
// pixel. All tests locally pass with a tolerance of 8 (uint8) and 0.03 (f16).
// pixel. All tests locally pass with a tolerance of 8 (uint8) and 0.035 (f16).
if (testScenario.canvasColorParam.pixelFormat == 'uint8') {
let tolerance_color = 4;
let tolerance_r_green = 8;
Expand All @@ -35,11 +35,9 @@
assert_approx_equals(actualPixels[i], refPixels[i], tolerance_color);
}
} else {
// For half float backed canvas, we expect the error < 0.01.
let tolerance_color = 0.01;
if (testScenario.encodeOptions.colorSpace == 'rec2020')
tolerance_color = 0.02;
let tolerance_r_green = 0.03;
// For half float backed canvas, we expect the error < 0.02.
let tolerance_color = 0.02;
let tolerance_r_green = 0.035;
for (let i = 0; i < actualPixels.length; i++) {
// Alpha channel
if (i % 4 == 3)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified third_party/blink/web_tests/svg/filters/feDropShadow-expected.png
Binary file modified third_party/blink/web_tests/svg/filters/feTile-expected.png
Binary file modified third_party/blink/web_tests/svg/filters/filter-clip-expected.png
Binary file modified third_party/blink/web_tests/svg/filters/innershadow-expected.png

0 comments on commit 1b07639

Please sign in to comment.