canvas: Image color profiles are ignore in color correct rendering mode |
||||
Issue descriptionWhen running with --enable-color-correct-rendering, images' embedded color spaces are ignored when they are drawn to a <canvas>. For non-canvas rasterized content (in issue 701942 ), we are using SkCreateColorSpaceXformCanvas to wrap our canvas, which will provide appropriate color space conversion.
,
Apr 8 2017
Attached example page -- the green bars should be on the top.
,
Apr 8 2017
In the case of non-displaylist canvas, throwing a SkCreateColorSpaceXformCanvas into Canvas2DLayerBridge::flushRecordingOnly seems to be good enough
For displaylist canvas, it's not as clear -- we're playing back into a SkCreateColorSpaceXformCanvas through RasterSource, but the conversion isn't happening. A quick stack of one of the places where we're not requesting the color space is:
blink::DecodingImageGenerator::onGetPixels(
SkImageGenerator::getPixels(
SkImageGenerator::tryGenerateBitmap(
SkImageCacherator::generateBitmap(
SkImageCacherator::tryLockAsBitmap(
SkImageCacherator::lockAsBitmap(
SkImage_Generator::getROPixels(
SkBaseDevice::drawImageRect(
SkCanvas::onDrawImageRect(
SkCanvas::drawImageRect(
SkCanvas::legacy_drawImageRect(
void SkRecords::Draw::draw<SkRecords::DrawImageRect>(
void SkRecords::Draw::operator(
decltype(
decltype(
SkRecordDraw(
SkBigPicture::playback(
SkCanvas::drawPicture(
SkCanvas::drawPicture(
SkCanvas::drawPicture(
SkPictureImageFilter::drawPictureAtDeviceResolution(
SkPictureImageFilter::onFilterImage(
SkImageFilter::filterImage(
SkBitmapDevice::drawSpecial(
SkCanvas::internalDrawDevice(
SkCanvas::internalRestore(
SkCanvas::restore(
* SkColorSpaceXformCanvas::willRestore(
SkCanvas::restore(
void SkRecords::Draw::draw<SkRecords::Restore>(
void SkRecords::Draw::operator(
decltype(
decltype(
SkRecordDraw(
SkBigPicture::playback(
cc::(
cc::DisplayItemList::Raster(
cc::RasterSource::RasterCommon(
I'll dig into it more next week.
,
Apr 13 2017
I updated the test page and attached it, and it appears that it isn't just the images that aren't being converted during playback. It appears that none of the <canvas> draw commands are color converted.
,
Apr 15 2017
Filed https://bugs.chromium.org/p/skia/issues/detail?id=6512 on the display-list mode (with a hacky fix...). Uploaded https://codereview.chromium.org/2820823004/ which fixes the layer-bridge issue, but I may want to refactor things a bit there.
,
Apr 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2639037b06c07f5613640e1a5f5a98c5932cb8a0 commit 2639037b06c07f5613640e1a5f5a98c5932cb8a0 Author: ccameron <ccameron@chromium.org> Date: Tue Apr 18 00:05:45 2017 Make Canvas2DLayerBridge use SkColorSpaceXformCanvas This makes legacy mode canvases render into sRGB (transforming images as needed). BUG= 709695 Review-Url: https://codereview.chromium.org/2820823004 Cr-Commit-Position: refs/heads/master@{#465069} [modify] https://crrev.com/2639037b06c07f5613640e1a5f5a98c5932cb8a0/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
,
Apr 18 2017
,
Apr 18 2017
These two examples are working on ToT now, closing. |
||||
►
Sign in to add a comment |
||||
Comment 1 by ccameron@chromium.org
, Apr 8 2017