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

Issue 2778483002: Synchronize commits at end of JS task (Closed)

Created:
3 years, 9 months ago by xlai (Olivia)
Modified:
3 years, 9 months ago
CC:
chromium-reviews, dshwang, ajuma+watch-canvas_chromium.org, blink-reviews-html_chromium.org, jam, haraken, dglazkov+blink, Rik, darin-cc_chromium.org, blink-reviews, piman+watch_chromium.org, kinuko+watch, blink-worker-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Synchronize commits at end of JS task This CL defers the submission of frames to the end of a JS task, so that the commits() for multiple OffscreenCanvases in the same execution context are happening at the same time. When a commit() comes in, there are three possible scenarios: 1. This is first commit since last resolved promise. In this case, we store the frame at m_currentFrame and register the context to task observer. 2. This is not the first commit for the same canvas in the same JS task. In this case, we overwrite the m_currentFrame but we do not duplicate registration to task observer. 3. This is the overdraw commit (the m_currentFrame has been dispatched but we are still waiting for the next OnBeginFrame to resolve the promise). In this case, we set the m_overdraw commit. When JS task finishes, finalizeFrame() will get fired and submit the current frame. When OnBeginFrame is fired, we'll resolve the promise if there is no current frame and no overdraw frame. If there is an overdraw frame, we doCommit for the overdraw frame and wait for next animation frame to resolve the promise. I've also modified the GPU pixel tests to test for all these situations. BUG=697582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2778483002 Cr-Commit-Position: refs/heads/master@{#459828} Committed: https://chromium.googlesource.com/chromium/src/+/a2095f6c1946afe6c434cf05eb4d419dd9b74275

Patch Set 1 #

Patch Set 2 : clean up #

Total comments: 5

Patch Set 3 : remove m_overdrawframe #

Total comments: 6

Patch Set 4 : fix comments #

Patch Set 5 : fix based on feedback #

Patch Set 6 : rebase #

Patch Set 7 : fix layout test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+442 lines, -295 lines) Patch
M content/test/data/gpu/pixel_offscreenCanvas_2d_commit_main.html View 1 2 3 3 chunks +82 lines, -43 lines 0 comments Download
M content/test/data/gpu/pixel_offscreenCanvas_2d_commit_worker.html View 1 2 3 2 chunks +84 lines, -44 lines 0 comments Download
M content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html View 2 chunks +89 lines, -75 lines 0 comments Download
M content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html View 3 chunks +102 lines, -90 lines 0 comments Download
M content/test/gpu/gpu_tests/pixel_expectations.py View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M content/test/gpu/gpu_tests/pixel_test_pages.py View 1 chunk +20 lines, -20 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-placeholder-image-source-with-worker.html View 1 2 3 4 5 6 2 chunks +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h View 1 2 3 4 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp View 1 2 3 4 5 4 chunks +34 lines, -18 lines 0 comments Download

Messages

Total messages: 30 (18 generated)
xlai (Olivia)
3 years, 9 months ago (2017-03-24 17:31:11 UTC) #3
Justin Novosad
https://codereview.chromium.org/2778483002/diff/20001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp File third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp (right): https://codereview.chromium.org/2778483002/diff/20001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp#newcode246 third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp:246: m_overdrawFrame = nullptr; We don't to track m_overdrawFrame anymore. ...
3 years, 9 months ago (2017-03-24 17:41:54 UTC) #4
xlai (Olivia)
https://codereview.chromium.org/2778483002/diff/20001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp File third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp (right): https://codereview.chromium.org/2778483002/diff/20001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp#newcode270 third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp:270: void OffscreenCanvas::doCommitAtEndOfTask() { On 2017/03/24 17:41:53, Justin Novosad wrote: ...
3 years, 9 months ago (2017-03-24 18:18:52 UTC) #5
Justin Novosad
https://codereview.chromium.org/2778483002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp File third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp (right): https://codereview.chromium.org/2778483002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp#newcode250 third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp:250: Platform::current()->currentThread()->addTaskObserver(m_context); I am concerned that the registration and de-registration ...
3 years, 9 months ago (2017-03-24 18:40:31 UTC) #6
xlai (Olivia)
https://codereview.chromium.org/2778483002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp File third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp (right): https://codereview.chromium.org/2778483002/diff/40001/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp#newcode250 third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp:250: Platform::current()->currentThread()->addTaskObserver(m_context); On 2017/03/24 18:40:31, Justin Novosad wrote: > I ...
3 years, 9 months ago (2017-03-24 19:50:17 UTC) #7
Justin Novosad
lgtm. This is good enough to ship IMHO OffscreenCanvas, but it is still not technically ...
3 years, 9 months ago (2017-03-24 20:40:59 UTC) #8
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/2778483002/80001
3 years, 9 months ago (2017-03-24 21:09:37 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/177296) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 9 months ago (2017-03-24 21:12:46 UTC) #12
xlai (Olivia)
+zmo@ to review the content/test/gpu/gpu_tests. This is just an update of new reference images of ...
3 years, 9 months ago (2017-03-24 21:27:38 UTC) #14
Zhenyao Mo
On 2017/03/24 21:27:38, xlai (Olivia) wrote: > +zmo@ to review the content/test/gpu/gpu_tests. > > This ...
3 years, 9 months ago (2017-03-27 17:55:22 UTC) #23
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/2778483002/120001
3 years, 9 months ago (2017-03-27 17:58:41 UTC) #27
commit-bot: I haz the power
3 years, 9 months ago (2017-03-27 18:13:35 UTC) #30
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/a2095f6c1946afe6c434cf05eb4d...

Powered by Google App Engine
This is Rietveld 408576698