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

Issue 1962413002: Implement transferToImageBitmap() in WebGLRenderingContext (Closed)

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

Description

Implement transferToImageBitmap() in WebGLRenderingContext To verify that WebGL Rendering works with OffscreenCanvas, we need to implement this function first. This CL also comes with two layout tests does the following things: 1. Rendering to OffscreenCanvas, call transferToImageBitmap, and draw the ImageBitmap to another canvas via transferFromImageBitmap. 2. Make sure the above case works on a worker thread. These two layout tests will eventually be moved to KhronosGroup as part of its conformance test. However, at this moment, the layout tests serve the purpose of verifying correctness of the code changes. BUG=610759 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel Committed: https://crrev.com/d30c45e8878402c605e467ce537897ef38748c98 Cr-Commit-Position: refs/heads/master@{#395065}

Patch Set 1 #

Total comments: 8

Patch Set 2 : layout test fails #

Total comments: 3

Patch Set 3 : works #

Total comments: 3

Patch Set 4 : using mailbox, it works #

Patch Set 5 : code clean up, almost identical to PS4 #

Total comments: 8

Patch Set 6 : address kbr@'s and bsalomon@'s comment #

Total comments: 3

Patch Set 7 : add new test case, cache SkIMage #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -2 lines) Patch
A third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap.html View 2 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-TexImage2D.html View 1 2 3 4 5 6 1 chunk +100 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-TexImage2D-expected.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html View 1 chunk +6 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-in-worker.html View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-in-worker-expected.html View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h View 1 2 3 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp View 1 2 3 4 5 6 3 chunks +41 lines, -0 lines 2 comments Download

Messages

Total messages: 44 (11 generated)
xidachen
PTAL
4 years, 7 months ago (2016-05-10 18:33:51 UTC) #4
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html File third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html (right): https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html#newcode4 third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html:4: <canvas id='output' width='100' height='100' style='background:red'></canvas> Apologies, I'm unfamiliar with ...
4 years, 7 months ago (2016-05-10 23:11:42 UTC) #5
Ken Russell (switch to Gerrit)
By the way, the new tests look good.
4 years, 7 months ago (2016-05-10 23:12:06 UTC) #6
xidachen
https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html File third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html (right): https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html#newcode4 third_party/WebKit/LayoutTests/fast/canvas/webgl/OffscreenCanvas-TransferToFromImageBitmap-expected.html:4: <canvas id='output' width='100' height='100' style='background:red'></canvas> On 2016/05/10 23:11:41, Ken ...
4 years, 7 months ago (2016-05-11 00:17:52 UTC) #7
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp (right): https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp#newcode90 third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp:90: attributes.setPremultipliedAlpha(false); On 2016/05/11 00:17:52, xidachen wrote: > On 2016/05/10 ...
4 years, 7 months ago (2016-05-11 01:00:42 UTC) #8
xidachen
https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp (right): https://codereview.chromium.org/1962413002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp#newcode90 third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp:90: attributes.setPremultipliedAlpha(false); On 2016/05/11 01:00:41, Ken Russell wrote: > On ...
4 years, 7 months ago (2016-05-11 01:07:08 UTC) #9
xidachen
https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode646 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:646: sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info, 0, (m_requestedAttributes.premultipliedAlpha()) ? ...
4 years, 7 months ago (2016-05-13 18:56:08 UTC) #10
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode646 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:646: sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info, 0, (m_requestedAttributes.premultipliedAlpha()) ? ...
4 years, 7 months ago (2016-05-13 20:08:30 UTC) #11
Justin Novosad
https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode646 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:646: sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info, 0, (m_requestedAttributes.premultipliedAlpha()) ? ...
4 years, 7 months ago (2016-05-13 20:36:27 UTC) #12
xidachen
https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode654 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:654: if (!(drawingBuffer()->copyToPlatformTexture(gl, textureId, GL_RGBA, GL_UNSIGNED_BYTE, 0, true, false, BackBuffer))) ...
4 years, 7 months ago (2016-05-17 17:02:00 UTC) #13
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode654 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:654: if (!(drawingBuffer()->copyToPlatformTexture(gl, textureId, GL_RGBA, GL_UNSIGNED_BYTE, 0, true, false, BackBuffer))) ...
4 years, 7 months ago (2016-05-18 01:20:41 UTC) #14
xidachen
https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/40001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode654 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:654: if (!(drawingBuffer()->copyToPlatformTexture(gl, textureId, GL_RGBA, GL_UNSIGNED_BYTE, 0, true, false, BackBuffer))) ...
4 years, 7 months ago (2016-05-18 15:13:36 UTC) #15
Ken Russell (switch to Gerrit)
Excellent. LGTM overall. Couple of comments. https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode644 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:644: return imageBitmap; This ...
4 years, 7 months ago (2016-05-19 00:15:12 UTC) #17
bsalomon
https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp (right): https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp#newcode97 third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp:97: sk_sp<SkImage> skImage = SkImage::MakeFromTexture(grContext, backendTexture); On 2016/05/19 00:15:11, Ken ...
4 years, 7 months ago (2016-05-19 12:57:20 UTC) #19
xidachen
https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode644 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:644: return imageBitmap; On 2016/05/19 00:15:11, Ken Russell wrote: > ...
4 years, 7 months ago (2016-05-19 13:48:29 UTC) #20
Justin Novosad
https://codereview.chromium.org/1962413002/diff/100001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp (right): https://codereview.chromium.org/1962413002/diff/100001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp#newcode77 third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp:77: OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()->createSharedOffscreenGraphicsContext3DProvider()); This is an unsafe assumption. ...
4 years, 7 months ago (2016-05-19 15:12:30 UTC) #21
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp (right): https://codereview.chromium.org/1962413002/diff/80001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp#newcode97 third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp:97: sk_sp<SkImage> skImage = SkImage::MakeFromTexture(grContext, backendTexture); On 2016/05/19 13:48:29, xidachen ...
4 years, 7 months ago (2016-05-19 18:04:47 UTC) #22
xidachen
https://codereview.chromium.org/1962413002/diff/100001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp (right): https://codereview.chromium.org/1962413002/diff/100001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp#newcode77 third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp:77: OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()->createSharedOffscreenGraphicsContext3DProvider()); On 2016/05/19 15:12:30, Justin Novosad ...
4 years, 7 months ago (2016-05-19 20:08:48 UTC) #23
Justin Novosad
On 2016/05/19 20:08:48, xidachen wrote: > Could you take a look at the new layout ...
4 years, 7 months ago (2016-05-19 20:26:35 UTC) #24
Justin Novosad
On 2016/05/19 20:26:35, Justin Novosad wrote: > On 2016/05/19 20:08:48, xidachen wrote: > > Could ...
4 years, 7 months ago (2016-05-19 20:27:36 UTC) #25
xidachen
In the implementation of texImage2d(ImageBitmap), we do do a readback of the SkImage and give ...
4 years, 7 months ago (2016-05-19 20:43:51 UTC) #26
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/1962413002/diff/120001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp (right): https://codereview.chromium.org/1962413002/diff/120001/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp#newcode98 third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp:98: m_image = fromSkSp(skImage); On 2016/05/19 20:43:51, xidachen wrote: > ...
4 years, 7 months ago (2016-05-19 21:38:42 UTC) #27
Justin Novosad
On 2016/05/19 20:43:51, xidachen wrote: > In the implementation of texImage2d(ImageBitmap), we do do a ...
4 years, 7 months ago (2016-05-19 21:39:11 UTC) #28
Ken Russell (switch to Gerrit)
On 2016/05/19 20:43:51, xidachen wrote: > In the implementation of texImage2d(ImageBitmap), we do do a ...
4 years, 7 months ago (2016-05-19 21:40:32 UTC) #29
Justin Novosad
FWIW, we don't have to fix all the problems all at once. To keep this ...
4 years, 7 months ago (2016-05-19 21:57:59 UTC) #30
xidachen
On 2016/05/19 21:57:59, Justin Novosad wrote: > FWIW, we don't have to fix all the ...
4 years, 7 months ago (2016-05-20 01:22:20 UTC) #31
Ken Russell (switch to Gerrit)
On 2016/05/20 01:22:20, xidachen wrote: > On 2016/05/19 21:57:59, Justin Novosad wrote: > > FWIW, ...
4 years, 7 months ago (2016-05-20 02:05:46 UTC) #32
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1962413002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1962413002/120001
4 years, 7 months ago (2016-05-20 10:38:34 UTC) #34
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-20 12:25:27 UTC) #36
Justin Novosad
On 2016/05/20 12:25:27, commit-bot: I haz the power wrote: > Dry run: This issue passed ...
4 years, 7 months ago (2016-05-20 13:33:02 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1962413002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1962413002/120001
4 years, 7 months ago (2016-05-20 13:34:36 UTC) #40
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 7 months ago (2016-05-20 13:38:31 UTC) #42
commit-bot: I haz the power
4 years, 7 months ago (2016-05-20 13:40:10 UTC) #44
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/d30c45e8878402c605e467ce537897ef38748c98
Cr-Commit-Position: refs/heads/master@{#395065}

Powered by Google App Engine
This is Rietveld 408576698