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

Issue 667420 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Feb 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 634542
issue 667411



Sign in to add a comment

Allow blink::Image::draw to specify a desired color space for the image

Project Member Reported by ccameron@chromium.org, Nov 21 2016

Issue description

blink::Image does not currently have a coherent color space
- for most subclasses, the color space is implicitly sRGB
- for some blink::BitmapImages, the color space is implicitly sRGB
- for some blink::BitmapImages, the color space is the output monitor color space

In legacy color mode, we will need to convert the images to output color space.

In true color mode, we will want to leave the images in their original color space.

At present, we never specify the target color space, rather it gets implicitly picked up by a global variable in blink::ImageDecoder.

This bug is to
- make things that draw images explicitly specify which color space they want images to be in (or none if they want a tagged input)
- add conversion of images

 
Blocking: 667411
Cc: zakerinasab@chromium.org
I just went through my bug backlog and saw that  issue 665919  is trying to solve the same problem.
The general idea I had for this is as follows:

Background:
- blink::ImageDecoder is the thing that actually provides pixels and does conversions
- blink::ImageFrameGenerator has an ImageDecoder (other things do, too)
- blink::DecodingImageGenerator has an ImageFrameGenerator
- blink::DeferredImageDecoder (and some other things) have a DecodingImageGenerator and an ImageDecoder
- blink::ImageSource has a DeferredImageDecoder
- blink::BitmapImage has an ImageSource

An idea that I had was to

1. Specify to blink::ImageDecoder (maybe at create time, maybe after) the output color space that is desired. I was only thinking of 8-bit formats -- adding FP16 would be do-able here, although more refactoring.

2. Force blink::DeferredImageDecoder, DecodingImageGenerator, and ImageFrameGenerator to specify output color space at creation time.

3. In blink::ImageSource, change m_decoder from being a single DeferredImageDecoder to being a map from SkColorSpaces to DeferredImageDecoder

4. Have blink::BitmapImage::draw select the color space as needed.

WRT the overlap with  issue 665919 , parts 1 and 2 are common, but there may be some divergence in parts 3 and 4 (which are the parts that I'm less certain of).
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 22 2016

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

commit 06f9ccab7e622c578258288e38554c05ec9a8dab
Author: ccameron <ccameron@chromium.org>
Date: Tue Nov 22 03:53:34 2016

Create ImageDecoder target color space

This is towards allowing us to specify the transform that we want
applied to the image as it is decoded, as opposed to getting whatever
the global transform is.

This does not change any behavior.

BUG= 667420 

Review-Url: https://codereview.chromium.org/2512683003
Cr-Commit-Position: refs/heads/master@{#433781}

[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
[modify] https://crrev.com/06f9ccab7e622c578258288e38554c05ec9a8dab/third_party/WebKit/Source/web/WebViewImpl.cpp

Cc: vmi...@chromium.org
So that I don't misplace it, here is a fleshing out of the change to allow canvas and raster to pull out differently-transformed images: https://codereview.chromium.org/2530443004 (with dependencies on the elephantine https://codereview.chromium.org/2523943002).

Victor had suggested doing this in custom display lists -- that may ultimately be a cleaner way.
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 30 2016

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

commit c8f175a4cbe14604f5b0f32b421a2be344a269bf
Author: ccameron <ccameron@chromium.org>
Date: Wed Nov 30 23:38:37 2016

This is towards removing the global variable that specifies the target
color profile for all image decode.

The core of this change is the change to ImageDecoder::ColorSpaceOption.
Prior to this change, the options for image decode were
  * Ignore color entirely
  * "Apply" that global profile, whatever it happens to be
There was one other mode, behind the EnableColorCorrectRendering flag,
which would
  * Tag the SkImages that came out of the ImageDecoder with the embedded
    color profile.

After this change, we still have the same 3 options, but they no longer
use global variables or command line flags. The ColorSpaceOption enum
has three states
  * Ignore color entirely
  * Transform the image into an explicitly specified (in the
    constructor) color space.
  * Tag the SkImages for that come out of the ImageDecoder.

Most of the change is just plumbing these variables though all of the
ImageDecoder related classes. The two other parts are as follows.

This patch makes it explicit when SkColorSpaces related to an image
are to be used with the SkImages (and SkImageInfos) for the image.
Previously, this distinction was less clear.

This patch also plumbs the ColorSpaceOption correctly from ImageSource
through to ImageDecoder. The path is
  ImageSource ->
  DeferredImageDecoder ->
  DeferredImageGenerator ->
  ImageFrameGenerator ->
  ImageDecoder
This just involves stashing the ColorSpaceOption and target color space
at the required stages along the way, to ensure that the final
ImageDecoder is created with the initially-specified arguments.

R=pdr,junov
TBR=peter
BUG= 667420 

Review-Url: https://codereview.chromium.org/2523943002
Cr-Commit-Position: refs/heads/master@{#435478}

[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/exported/WebImage.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/ImageSource.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
[modify] https://crrev.com/c8f175a4cbe14604f5b0f32b421a2be344a269bf/third_party/WebKit/Source/web/WebImageDecoder.cpp

Blocking: 634542
Project Member

Comment 8 by bugdroid1@chromium.org, Dec 7 2016

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

commit bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf
Author: ccameron <ccameron@chromium.org>
Date: Wed Dec 07 23:06:24 2016

Merge color options into ColorBehavior

There are dozens of places where we were passing an
blink::ImageDecoder::ColorSpaceOption and sk_sp<SkColorSpace>. Merge
these into a single ColorBehavior structure.

TBR=peter
BUG= 667420 

Review-Url: https://codereview.chromium.org/2556723003
Cr-Commit-Position: refs/heads/master@{#437100}

[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/exported/WebImage.cpp
[add] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
[add] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ColorBehavior.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/ImageSource.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/web/WebImageDecoder.cpp
[modify] https://crrev.com/bf8e2f1a7b41c6f96136f9fc9617e685e0cb92bf/third_party/WebKit/Source/web/WebViewImpl.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Dec 9 2016

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

commit 80eae1dfec8262cb7cc2f585d85d1d41a63a1168
Author: ccameron <ccameron@chromium.org>
Date: Fri Dec 09 10:49:12 2016

Allow specifying ColorBehavior to ImageSource

This patch has no functional change, but will allow subsequent patches
to specify a different target color space depending on their application
(e.g, canvas and WebGL can request sRGB, and raster can request
the output device behavior).

BUG= 667420 

Review-Url: https://codereview.chromium.org/2556973002
Cr-Commit-Position: refs/heads/master@{#437514}

[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/LayoutTests/VirtualTestSuites
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/BitmapImage.h
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/ColorBehavior.h
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/ImageSource.cpp
[modify] https://crrev.com/80eae1dfec8262cb7cc2f585d85d1d41a63a1168/third_party/WebKit/Source/platform/graphics/ImageSource.h

Project Member

Comment 10 by bugdroid1@chromium.org, Dec 9 2016

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

commit 7d997bde5eb18172951ccc321744929aea560d36
Author: ccameron <ccameron@chromium.org>
Date: Fri Dec 09 22:06:00 2016

Add ColorBehavior to Image draw methods

Add a ColorBehavior argument to
- blink::Image::imageForCurrentFrame
- blink::Image::draw
- blink::Image::applyShader

Plumb these arguments through to all sub-classes. For sub-classes where
there is a trivial implementation, add it (e.g, blink::BitmapImage).
For all other sub-classes and callsites that need behavior changes, add
TODOs referencing the appropriate bugs.

This patch should have no behavior change -- it just formally
propagates arguments that were previously implied or pulled out of
global variables.

BUG= 667420 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2559013002
Cr-Commit-Position: refs/heads/master@{#437666}

[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/modules/shapedetection/ShapeDetector.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/DragImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/DragImageTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/exported/WebImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/BitmapImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GeneratedImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/Image.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/Image.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h
[modify] https://crrev.com/7d997bde5eb18172951ccc321744929aea560d36/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp

Status: WontFix (was: Started)
This wasn't the right solution -- we're now having color conversion be done at raster time by specifying the color space to the SkSurface.

Marking WontFix and reverting.
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 2 2017

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

commit 0713546fe2092b05fb75c52ba9da223adda2681f
Author: ccameron <ccameron@chromium.org>
Date: Thu Mar 02 02:29:29 2017

color: Remove blink pre-conversion code

This removes ColorBehavior as a parameter to Image::draw. We will be
specifying color behavior on the SkSurface that we render to, so this
parameter is unneeded.

Make most callers to ColorBehavior specify ColorBehavior::defaultBehavior,
which will check runtime parameters to decide if pre-conversion or tagging
is appropriate.

Delete all references to "true color mode" -- Blink will not behave differently
in the two modes (it will always tag its inputs with their SkColorSpace).

Leave ColorBehavior as an argument to ImageDecoder, because some
interfaces (WebGL in particular) will want to specify the "ignore" behavior.

Don't remove ColorBehavior as an argument to imageForCurrentFrame, at
least yet. The SkImage created will need to specify some color space,
and allowing the caller to parameterize that is reasonable.

R=junov,chrishtr
TBR=esprehn
BUG= 667411 
BUG= 667420 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2712083002
Cr-Commit-Position: refs/heads/master@{#454155}

[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/layout/shapes/Shape.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/svg/graphics/SVGImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/DragImageTest.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/BitmapImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/Image.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/Image.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
[modify] https://crrev.com/0713546fe2092b05fb75c52ba9da223adda2681f/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h

Sign in to add a comment