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

Issue 2490443002: Make OffscreenCanvas an EventTarget (Closed)

Created:
4 years, 1 month ago by xidachen
Modified:
4 years, 1 month ago
CC:
chromium-reviews, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, haraken, dglazkov+blink, Rik, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make OffscreenCanvas an EventTarget Right now OffscreenCanvas is not an EventTarget, which means that it cannot listen to any event such as webgl context lost and restoration. This CL makes OffscreenCanvas an EventTarget. In order to override the pure virtual function getExecutionContext in EventTarget, we keep a Member<ExecutionContext> in OffscreenCanvas. We also added some layout tests here. In this CL, we only tests webgl context lost and restoration. The layout tests here should be upstreamed to khronos group on github later on once the spec for OffscreenCanvas is landed. Also, notice that the context lost test in worker verifies that all WebGL's API works in a worker. Note that the tests we have here is pretty much copied from the webgl's conformance tests. BUG=655270, 610759, 630515 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 Committed: https://crrev.com/8372014fc16a378fc7452164db9b3b89fbd62909 Cr-Commit-Position: refs/heads/master@{#432478}

Patch Set 1 #

Patch Set 2 : tests added #

Total comments: 3

Patch Set 3 : keep a Member<ExecutionContext> in OffscreenCanvas #

Total comments: 4

Patch Set 4 : Changes to WeakMember #

Patch Set 5 : main thread test works, worker needs to reformat #

Patch Set 6 : all tests are fine #

Total comments: 2

Patch Set 7 : add comment #

Patch Set 8 : pass API layout tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1243 lines, -36 lines) Patch
A third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost.html View 1 1 chunk +310 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html View 1 2 3 4 5 1 chunk +217 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored-worker.html View 1 2 3 4 5 1 chunk +230 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-worker.html View 1 2 3 4 5 1 chunk +402 lines, -0 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 1 chunk +1 line, -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 1 chunk +1 line, -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 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -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 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/EventTargetFactory.in View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h View 1 2 3 4 4 chunks +17 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 6 7 9 chunks +55 lines, -26 lines 0 comments Download

Messages

Total messages: 39 (22 generated)
xidachen
PTAL https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html File third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html (right): https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html#newcode78 third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html:78: // assert_false(gl.isContextLost()); kbr@, zmo@: could you please provide ...
4 years, 1 month ago (2016-11-13 01:53:41 UTC) #4
Justin Novosad
https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h (right): https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h#newcode1599 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h:1599: Member<ExecutionContext> m_executionContext; Storing this in the rendering context is ...
4 years, 1 month ago (2016-11-14 16:41:00 UTC) #5
xidachen
https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h (right): https://codereview.chromium.org/2490443002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h#newcode1599 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h:1599: Member<ExecutionContext> m_executionContext; On 2016/11/14 16:41:00, Justin Novosad wrote: > ...
4 years, 1 month ago (2016-11-14 18:48:12 UTC) #7
Justin Novosad
lgtm with nits https://codereview.chromium.org/2490443002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h File third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h (right): https://codereview.chromium.org/2490443002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h#newcode125 third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h:125: Member<ExecutionContext> m_executionContext; Nit: This reference is ...
4 years, 1 month ago (2016-11-14 19:45:08 UTC) #8
Ken Russell (switch to Gerrit)
WebGL changes lgtm. I defer to junov@'s review of the rest.
4 years, 1 month ago (2016-11-14 19:54:16 UTC) #9
xidachen
https://codereview.chromium.org/2490443002/diff/40001/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html File third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html (right): https://codereview.chromium.org/2490443002/diff/40001/third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html#newcode78 third_party/WebKit/LayoutTests/fast/canvas/webgl/offscreenCanvas-context-lost-restored.html:78: // assert_false(gl.isContextLost()); Ken, this test fails here if I ...
4 years, 1 month ago (2016-11-14 19:56:38 UTC) #10
xidachen
kbr@, junov@: could either one of you please take a look at the webgl/ changes? ...
4 years, 1 month ago (2016-11-15 17:04:11 UTC) #12
xidachen
On 2016/11/15 17:04:11, xidachen wrote: > kbr@, junov@: could either one of you please take ...
4 years, 1 month ago (2016-11-15 17:12:57 UTC) #13
Justin Novosad
https://codereview.chromium.org/2490443002/diff/100001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/2490443002/diff/100001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode7365 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:7365: DrawingBuffer::DisallowChromiumImage); Why? Perhaps add a comment.
4 years, 1 month ago (2016-11-15 19:54:33 UTC) #14
xidachen
https://codereview.chromium.org/2490443002/diff/100001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp File third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp (right): https://codereview.chromium.org/2490443002/diff/100001/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp#newcode7365 third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp:7365: DrawingBuffer::DisallowChromiumImage); On 2016/11/15 19:54:33, Justin Novosad wrote: > Why? ...
4 years, 1 month ago (2016-11-15 20:14:19 UTC) #15
Justin Novosad
lgtm
4 years, 1 month ago (2016-11-15 20:22:24 UTC) #16
Ken Russell (switch to Gerrit)
Still lgtm
4 years, 1 month ago (2016-11-15 21:33:45 UTC) #20
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/2490443002/120001
4 years, 1 month ago (2016-11-15 23:36:11 UTC) #22
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/2490443002/140001
4 years, 1 month ago (2016-11-16 02:24:12 UTC) #29
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/2490443002/140001
4 years, 1 month ago (2016-11-16 14:16:34 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-11-16 14:20:44 UTC) #37
commit-bot: I haz the power
4 years, 1 month ago (2016-11-16 14:24:00 UTC) #39
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/8372014fc16a378fc7452164db9b3b89fbd62909
Cr-Commit-Position: refs/heads/master@{#432478}

Powered by Google App Engine
This is Rietveld 408576698