Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Issue 2797213002: Fix BaseRenderingContext2D create/put/get-ImageData() for color managed canvas (Closed)

Created:
3 years, 8 months ago by zakerinasab
Modified:
3 years, 7 months ago
Reviewers:
fserb, Justin Novosad
CC:
fserb, ajuma+watch-canvas_chromium.org, blink-reviews, Rik, chromium-reviews, dshwang, haraken
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/03d8a3084d1e21b685437607961f5ddccdf032b1

Patch Set 1 : work in progress, checking trybots #

Patch Set 2 : Trying to fix trybot failures #

Patch Set 3 : Layout test added #

Total comments: 4

Patch Set 4 : Addressing trybot failures on the layout test #

Patch Set 5 : Addressing comments #

Total comments: 1

Patch Set 6 : Rebaseline #

Patch Set 7 : Removing renderingContext(), moving createImageData() to CRC2 and OCRC2 #

Patch Set 8 : Rebaseline #

Total comments: 24

Patch Set 9 : Addressing comments #

Patch Set 10 : Fixing more interface listings fails #

Total comments: 8

Patch Set 11 : Fixing ImageBuffer and unit tests #

Patch Set 12 : Addressing comments from patch set 10 #

Patch Set 13 : Corrections #

Total comments: 1

Patch Set 14 : Rebaseline after ccameron@ CL for CanvasColorParams #

Patch Set 15 : Rebaseline #

Unified diffs Side-by-side diffs Delta from patch set Stats (+649 lines, -165 lines) Patch
M third_party/WebKit/LayoutTests/external/wpt/WebIDL/current-realm-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/fast/canvas/color-space/imageData-colorSpace.html View 1 2 3 1 chunk +0 lines, -72 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/virtual/color_space/fast/canvas/color-space/canvas-createPutGetImageData-colorManaged.html View 1 2 3 4 5 6 7 8 1 chunk +129 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/virtual/color_space/fast/canvas/color-space/imageData-colorSpace.html View 1 2 3 4 5 6 2 chunks +8 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/ImageData.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +11 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/html/ImageData.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +21 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/ImageData.idl View 1 2 3 4 5 6 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +28 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +100 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +286 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/CanvasColorParams.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +15 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -37 lines 0 comments Download

Messages

Total messages: 56 (34 generated)
zakerinasab
A layout test is provided to test user side call site for all the possible ...
3 years, 8 months ago (2017-04-06 18:10:31 UTC) #3
Justin Novosad
https://codereview.chromium.org/2797213002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2797213002/diff/40001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode1698 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:1698: RuntimeEnabledFeatures::colorCorrectRenderingEnabled(); This check is copied in many placed, perhaps ...
3 years, 8 months ago (2017-04-06 19:01:04 UTC) #4
fserb
https://codereview.chromium.org/2797213002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h (right): https://codereview.chromium.org/2797213002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode379 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h:379: virtual const CanvasRenderingContext* renderingContext() const { talking to junov@ ...
3 years, 8 months ago (2017-04-07 20:03:33 UTC) #6
zakerinasab
On 2017/04/07 20:03:33, fserb wrote: > https://codereview.chromium.org/2797213002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h > File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h > (right): > > https://codereview.chromium.org/2797213002/diff/80001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h#newcode379 ...
3 years, 8 months ago (2017-04-10 21:09:10 UTC) #8
fserb
https://codereview.chromium.org/2797213002/diff/160001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/2797213002/diff/160001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode41 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:41: is_color_managed_ = a RenderingContext is color managed even if ...
3 years, 8 months ago (2017-04-11 03:21:44 UTC) #9
zakerinasab
New CL uploaded. I addressed Fernando's comments (except one which I didn't get the question), ...
3 years, 8 months ago (2017-04-11 19:53:00 UTC) #10
Justin Novosad
https://codereview.chromium.org/2797213002/diff/200001/third_party/WebKit/Source/core/html/ImageData.h File third_party/WebKit/Source/core/html/ImageData.h (right): https://codereview.chromium.org/2797213002/diff/200001/third_party/WebKit/Source/core/html/ImageData.h#newcode92 third_party/WebKit/Source/core/html/ImageData.h:92: static ImageData* createImageData(unsigned width, With these function no longer ...
3 years, 8 months ago (2017-04-11 21:28:05 UTC) #11
zakerinasab
Comments addressed. Unit tests are done. Will try to land after another quick review from ...
3 years, 8 months ago (2017-04-15 07:04:43 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797213002/340001
3 years, 8 months ago (2017-04-17 21:59:54 UTC) #23
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 8 months ago (2017-04-17 21:59:56 UTC) #25
fserb
lgtm https://codereview.chromium.org/2797213002/diff/340001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (left): https://codereview.chromium.org/2797213002/diff/340001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#oldcode1699 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:1699: buffer->PutByteArray(kUnmultiplied, data->data()->Data(), lol "data->data()->Data()" :))
3 years, 8 months ago (2017-04-19 17:32:52 UTC) #31
Justin Novosad
lgtm
3 years, 7 months ago (2017-04-26 18:37:40 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797213002/380001
3 years, 7 months ago (2017-04-26 18:49:10 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/439763)
3 years, 7 months ago (2017-04-26 20:35:21 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797213002/380001
3 years, 7 months ago (2017-04-26 20:37:16 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/439818)
3 years, 7 months ago (2017-04-26 22:42:27 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797213002/380001
3 years, 7 months ago (2017-04-27 01:26:56 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/440203)
3 years, 7 months ago (2017-04-27 03:20:23 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2797213002/380001
3 years, 7 months ago (2017-04-27 10:31:43 UTC) #51
commit-bot: I haz the power
Committed patchset #15 (id:380001) as https://chromium.googlesource.com/chromium/src/+/03d8a3084d1e21b685437607961f5ddccdf032b1
3 years, 7 months ago (2017-04-27 11:11:08 UTC) #54
RE66
On 2017/04/27 11:11:08, commit-bot: I haz the power wrote: > Committed patchset #15 (id:380001) as ...
3 years, 7 months ago (2017-04-27 11:43:37 UTC) #55
zakerinasab
3 years, 7 months ago (2017-04-27 12:17:47 UTC) #56
Message was sent while issue was closed.
On 2017/04/27 11:43:37, RE66 wrote:
> On 2017/04/27 11:11:08, commit-bot: I haz the power wrote:
> > Committed patchset #15 (id:380001) as
> >
>
https://chromium.googlesource.com/chromium/src/+/03d8a3084d1e21b685437607961f...
> 
> I do not understand why a conversion from float16 to float32 
> Is done.
> It take twice the memory with no bettecoloring.
> Many many machine atr using float16. For this machines
> You double memory of image
> Total memory huge

Half-float arrays are not supported by JavaScript (see here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).
Therefore, to expose float data in JS we have to use Float32Array (or
Float64Array).

Powered by Google App Engine
This is Rietveld 408576698