Use SkImage::readPixels in color managed canvas code |
||||
Issue descriptionSkImage::makeColorSpace() is still getting developed. When skia:6553 is fixed, replace SkImage::readPixels() with SkImage::makeColorSpace() for color conversion of SkImage objects in color managed canvas code.
,
Apr 26 2017
There are different scenarios. For one, the image bitmap source may be in color space X, but the ImageBitmapOptions may indicate that the target image bitmap is expected to be in color space Y. If image bitmap source uses an SkImage as the storage, we can simply add a method to the image bitmap source that calls SkImage::makeColorSpace() on the SkImage object and returns one with the desired color space. Afterward, we can apply other features asked in ImageBitmapOptions over the color converted SkImage.
,
Apr 26 2017
Got it. This manipulation of ImageBitmaps is exposed in the Canvas API?
,
Apr 26 2017
Yes. See https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/imagebitmap/ImageBitmapOptions.idl?q=imagebitmapoptions.idl&dr. P3 and Rec2020 will be added soon.
,
Apr 26 2017
colorSpaceConversion creation attribute specifies the desired color space of the ImageBitmap object, to which the image bitmap source must be color converted.
,
Jun 8 2017
SkImage::readPixels now supports correct color conversion and is the desired way to do so.
,
Jun 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/70d96a8266f71bb56e1cbbc54689b59d8eab5d40 commit 70d96a8266f71bb56e1cbbc54689b59d8eab5d40 Author: Reza.Zakerinasab <zakerinasab@chromium.org> Date: Tue Jun 13 19:14:11 2017 Refactor ImageBitmap This CL refactors ImageBitmap. It was essentially started to fix ImageBitmap constructor from ImageData which was not correctly handling ColorSpaceConversion attribute passed in ImageBitmapOptions. During the developement it gradually extended to improving other constructors too. (This CL is moved from Rietveld codereview.chromium.org/2845193002.) BUG= 714649 , 683307 ,627855, 715264 , 715239 , 714364 , 686862 , 665919 Change-Id: Iecba66e8764b189a4f5130096b4b5a19a9a32cae Reviewed-on: https://chromium-review.googlesource.com/527690 Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/master@{#479093} [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage-expected.txt [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-out-of-bounds-src-expected.html [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-recursive.html [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/LayoutTests/fast/canvas/webgl/resources/tex-image-and-sub-image-image-bitmap-utils.js [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/frame/ImageBitmap.cpp [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/html/ImageData.cpp [modify] https://crrev.com/70d96a8266f71bb56e1cbbc54689b59d8eab5d40/third_party/WebKit/Source/core/html/ImageData.h
,
Aug 10 2017
This is done for now as we have replaced readPixels() with makeColorSpace() wherever possible.
,
Nov 27 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by msar...@google.com
, Apr 26 2017