New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 859102 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 23
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Canvas color space tests with transparent pixels are disabled

Project Member Reported by brianosman@google.com, Jun 29 2018

Issue description

Skia's handling of color space conversion for transparent pixels is changing. Software rasterization of this content is also changing. To make this tractable, I'm disabling the portions of the relevant layout tests that deal with transparent pixels, temporarily. Once the changes to the software backend and complete, we'll need to re-enable these tests with new baseline values.
 
For reference, we've made a new (simpler) fiddle to help with color conversion. This converts some sRGB colors to a variety of other color spaces, and bypasses ALL of the (in flux) Skia code, giving what should be ground-truth answers:

https://fiddle.skia.org/c/d15c1fd62f1bf4954f7040422eeea7f9
The detail here is, for a given non-linear transfer function tf(), we currently have spotty support for working with colors premultiplied in two different ways:

   tf(r)*a
   tf(r*a)

These correspond to the kIgnore and kRespect options of SkTransferFunctionBehavior, respectively, and also respectivevly skcms' PremulAsEncoded and PremulLinear.

When tf() is an identity function (think, linear sRGB) the distinction is moot.  Because of that, we've noticed that we can support all existing and proposed user demands for color space management by always using the kIgnore/PremulAsEncoded tf(r)*a style of premultiplication.

Lots of the layout tests enforce that we use linear premul instead, or worse, a mix of the two stemming from that spotty support I mentioned before.

Nothing will change for opaque or unpremultiplied colors, so we still should be able to maintain good testing coverage there for most color space management.

If you use Brian's fiddle and want to work with premul values, please make sure to use PremulAsEncoded.  We're working to remove PremulLinear asap.
Components: Blink>Canvas
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 3

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41eca5edd48d16bf3417840e401c302af9c82e3a

commit 41eca5edd48d16bf3417840e401c302af9c82e3a
Author: Brian Osman <brianosman@google.com>
Date: Tue Jul 03 18:03:00 2018

Remove all usage of SkTransferFunctionBehavior::kRespect

This is going away in Skia (no one wants linear blending), so this lets
us land some Skia changes that alter image encode/decode/conversion
behavior without breaking webkit unit tests.

Some canvas color space layout tests do break, because they exercise
multiple code paths in Skia. The paths that depend on image encode
and decode are now using nonlinear blending, but the paths that just
draw (to SW canvas) are hitting code that isn't updated yet. To make
it easier to finish that migration, this change suppresses all of the
transparent pixel tests within those five layout tests.

Bug:  chromium:859102   chromium:844145 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I331b5dfc08e53d498fdc1449519b42f67de6d1af
Reviewed-on: https://chromium-review.googlesource.com/1117026
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572292}
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/skia/config/SkUserConfig.h
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-colorManaged-convertToBlob-roundtrip.html
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-linear-rgb.html
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-p3.html
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-rec2020.html
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/WebKit/LayoutTests/fast/canvas/color-space/transferFromImageBitmap.html
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator_test.cc
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc
[modify] https://crrev.com/41eca5edd48d16bf3417840e401c302af9c82e3a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f00775a25c39096b10bfefb736e3e3e786303579

commit f00775a25c39096b10bfefb736e3e3e786303579
Author: Mike Klein <mtklein@chromium.org>
Date: Wed Jul 11 21:12:36 2018

disable fast/canvas/color-space/canvas-drawImage-*

These layout tests exercise color management with transparency,
which is known to be a little broken.  Disable the tests so that
we can roll Skia code with a fix.

I'm still puzzled why we didn't catch the virtual/gpu versions
of these tests earlier.

Bug:  chromium:859102 
Change-Id: I0bfd3014b80e91adbfc82a08746205e1fd35764e
Reviewed-on: https://chromium-review.googlesource.com/1134025
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574336}
[modify] https://crrev.com/f00775a25c39096b10bfefb736e3e3e786303579/third_party/WebKit/LayoutTests/TestExpectations

Owner: brianosman@chromium.org
What's the status here?
We're very close in Skia to have all the capability for this to be working correctly now.

I think our plan for most everything new-color-management in Chromium is to first switch over a smaller user of Skia like Flutter.  We figure we'll uncover a few bugs there that will be easier and quicker to deal with in a small project than if we wait to find them in Chromium.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 23

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401

commit c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Tue Oct 23 15:42:34 2018

Set the default color space of half float backed canvas to e-sRGB

Bug:  894516 ,  859102 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I38739a0c7e84426d4345632c1fad474bd3629cb3
Reviewed-on: https://chromium-review.googlesource.com/c/1283481
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601964}
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/ImageData-fidelity.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-colorManaged-convertToBlob-roundtrip.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-colorManaged-toBlob-toDataURL.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-colorspace-arguments.html
[add] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-e_srgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-linear-rgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-p3.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createImageBitmap-rec2020.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-createPutGetImageData-colorManaged.html
[rename] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-draw-high-bit-depth-images.html
[add] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-drawImage-e_srgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-drawImage-linear-rgb.html
[add] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-drawImage-offscreenCanvas.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-drawImage-p3.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-drawImage-rec2020.html
[add] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-getImageData-e_srgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/canvas-getImageData-linear-rgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/display_linear-rgb.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/imageData-colorManagedBehavior.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/imageData-colorSpace.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/WebKit/LayoutTests/fast/canvas/color-space/transferFromImageBitmap.html
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/bindings/core/v8/serialization/serialized_color_params.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/bindings/core/v8/serialization/serialized_color_params.h
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer_test.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/html/canvas/image_data.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/html/canvas/image_data_color_settings.idl
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/html/canvas/image_data_test.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_test.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/platform/graphics/canvas_color_params.h
[modify] https://crrev.com/c1b25cfc5de812cc5c58d6e2a5f68f2766ad2401/third_party/blink/renderer/platform/graphics/canvas_color_params_test.cc

Status: Fixed (was: Assigned)

Sign in to add a comment