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

Issue 2039983002: Change code path for structured cloning ImageBitmap (Closed)

Created:
4 years, 6 months ago by xidachen
Modified:
4 years, 5 months ago
Reviewers:
haraken, jbroman
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change code path for structured cloning ImageBitmap This is how it works currently: When an ImageBitmap is un-premultiplied, we read bitmap's pixel data in premultiplied format. When de-serialize happens, we call ImageBitmap::create(ImageData*) and in that create() function, we create an SkImage that is in premultiplied format because the input data is already premultiplied. This is causing the problem because the SkImage should be in un-premultiplied format. We change the implementation like this: When we serialize the ImageBitmap into uint8_t*, we read the pixel data according to whether the ImageBitmap is premultiplied or not, also we store the information whether the bitmap is premultiplied or not. When de-serialization happens, we design a new ImageBitmap constructor specifically for it. Notice that after this change, the layout tests fast/canvas/webgl/texImage-imageBitmap-structured-clone.html passes. BUG=615172 Committed: https://crrev.com/58c08f3acefbd7a44387d03237967a4644130c0f Cr-Commit-Position: refs/heads/master@{#403475}

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 6

Patch Set 3 : address comments #

Patch Set 4 : DEBUG, DONOT COMMIT THIS PS #

Patch Set 5 : This PS works, but needs code clean up #

Patch Set 6 : clean up code, should work #

Total comments: 12

Patch Set 7 : address comments #

Total comments: 5

Patch Set 8 : address comments #

Total comments: 3

Patch Set 9 : more comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -51 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/canvas/canvas-ImageBitmap-structured-clone.html View 4 7 chunks +13 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 2 3 4 5 6 7 4 chunks +32 lines, -24 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 4 5 6 7 8 4 chunks +12 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 7 8 6 chunks +19 lines, -12 lines 0 comments Download

Messages

Total messages: 25 (9 generated)
xidachen
PTAL
4 years, 5 months ago (2016-06-27 18:42:55 UTC) #3
jbroman
I'm a little confused here. Why read even premultiplied bitmaps back as unpremultiplied? https://codereview.chromium.org/2039983002/diff/20001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File ...
4 years, 5 months ago (2016-06-27 19:16:16 UTC) #4
xidachen
Using an example is probably the best way to demonstrate why we read back the ...
4 years, 5 months ago (2016-06-27 19:48:22 UTC) #5
xidachen
This CL is now ready for re-review. Thanks.
4 years, 5 months ago (2016-06-28 18:14:13 UTC) #7
jbroman
https://codereview.chromium.org/2039983002/diff/100001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/2039983002/diff/100001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode1761 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:1761: if (m_position + *pixelDataLength > m_length) nit: Not introduced ...
4 years, 5 months ago (2016-06-28 18:50:22 UTC) #8
xidachen
https://codereview.chromium.org/2039983002/diff/100001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/2039983002/diff/100001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode1761 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:1761: if (m_position + *pixelDataLength > m_length) On 2016/06/28 18:50:22, ...
4 years, 5 months ago (2016-06-29 12:58:35 UTC) #9
jbroman
https://codereview.chromium.org/2039983002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/2039983002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode1761 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:1761: if (m_position + *pixelDataLength > m_length || m_length - ...
4 years, 5 months ago (2016-06-29 15:10:34 UTC) #10
xidachen
https://codereview.chromium.org/2039983002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/2039983002/diff/120001/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode1761 third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp:1761: if (m_position + *pixelDataLength > m_length || m_length - ...
4 years, 5 months ago (2016-06-29 15:51:14 UTC) #11
jbroman
Okay, LGTM (with comments). Please do find time to double-check that things work correctly on ...
4 years, 5 months ago (2016-06-29 18:03:54 UTC) #12
xidachen
haraken@: gentle ping. Please take a look at bindings/ changes.
4 years, 5 months ago (2016-07-01 00:55:21 UTC) #13
haraken
On 2016/07/01 00:55:21, xidachen wrote: > haraken@: gentle ping. Please take a look at bindings/ ...
4 years, 5 months ago (2016-07-01 00:56:58 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2039983002/160001
4 years, 5 months ago (2016-07-01 01:02:14 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-07-01 02:17:13 UTC) #18
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/2039983002/160001
4 years, 5 months ago (2016-07-01 17:06:09 UTC) #21
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 5 months ago (2016-07-01 17:10:34 UTC) #23
commit-bot: I haz the power
4 years, 5 months ago (2016-07-01 17:13:28 UTC) #25
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/58c08f3acefbd7a44387d03237967a4644130c0f
Cr-Commit-Position: refs/heads/master@{#403475}

Powered by Google App Engine
This is Rietveld 408576698