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

Issue 709777 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Experimental versions of createImageData belong on CanvasRenderingContext2D

Project Member Reported by junov@chromium.org, Apr 9 2017

Issue description

Because the IDL parser does not allow for constructor overloads to be hidden behind a flag, we created factory methods on the ImageData interface.

These should have been static to avoid having to create a bogus ImageData object. But even better would be to put them on CRC2D and OCRC2D, with the other versions of createImageBitmap. Also, by default, createImageData should use the bit depth and color space of the rendering context it was called on. That should apply even for the existing versions of createImageBitmap.  This is the behavior specified in the proposal.

 

Comment 1 by junov@chromium.org, Apr 9 2017

Typo: where I wrote createImageBitmap in the description, I meant createImageData. (again, I know, LOL)
I assume that we need both versions for the spec (color managed ImageData constructors and color managed createImageData). In this case, I'll keep the methods in ImageData as private and expose them in CRC2D and OCRC2D.
Cc: junov@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 27 2017

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

commit 03d8a3084d1e21b685437607961f5ddccdf032b1
Author: zakerinasab <zakerinasab@chromium.org>
Date: Thu Apr 27 11:10:45 2017

Fix BaseRenderingContext2D create/put/get-ImageData() for color managed canvas

* createImageData() and getImageData() must return an ImageData for which the color space and storage format matches those of canvas.
If canvas pixel format is "float16", the storage format of the returned ImageData must be "float32". Values must be properly converted from float16 to float32.

* putImageData must do the color conversion from the color space and storage format of given ImageData to the color space and matching pixel format of canvas prior to putting data into the canvas.

BUG= 704155 , 709777 

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

[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/external/wpt/WebIDL/current-realm-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[add] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/color_space/fast/canvas/color-space/canvas-createPutGetImageData-colorManaged.html
[rename] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/color_space/fast/canvas/color-space/imageData-colorSpace.html
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/core/html/ImageData.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/core/html/ImageData.h
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/core/html/ImageData.idl
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/platform/graphics/CanvasColorParams.cpp
[modify] https://crrev.com/03d8a3084d1e21b685437607961f5ddccdf032b1/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment