[OffscreenCanvas] Synchronize commits at end of task |
||
Issue descriptionTo ensure that commits are synchronized in cases where we have multiple canvases on which commit() is called, we need to package the commits together, at the end of the current task. We need a way to package the committed frames in an atomic way to ensure that they are always presented simultaneously. One way to achieve the deferral would be to register a TaskObserver (see CavasRenderingContext for an example) that will dispatch the frames in the didProcessTask callback. This also need to work with the async/await JavaScript syntax. Not sure how TaskObserver interacts with that.
,
Mar 27 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a2095f6c1946afe6c434cf05eb4d419dd9b74275 commit a2095f6c1946afe6c434cf05eb4d419dd9b74275 Author: xlai <xlai@chromium.org> Date: Mon Mar 27 18:12:46 2017 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} [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/data/gpu/pixel_offscreenCanvas_2d_commit_main.html [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/data/gpu/pixel_offscreenCanvas_2d_commit_worker.html [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/gpu/gpu_tests/pixel_expectations.py [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/content/test/gpu/gpu_tests/pixel_test_pages.py [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-placeholder-image-source-with-worker.html [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp [modify] https://crrev.com/a2095f6c1946afe6c434cf05eb4d419dd9b74275/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
,
Mar 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/772204b647bb8089ed2017718cc4afdeac1d80d1 commit 772204b647bb8089ed2017718cc4afdeac1d80d1 Author: xlai <xlai@chromium.org> Date: Tue Mar 28 23:34:15 2017 Shrink the reference image dimension in OffscreenCanvas tests The android device has a screen resolution width of 1080 and devicePixelRatio of 2.625. As a result, the width of 600 in the existing gpu pixel tests is too big as width * devicePixelRatio > screen resolution. Therefore, I shrink the test rect to 400 in width. 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.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2774423006 Cr-Commit-Position: refs/heads/master@{#460237} [modify] https://crrev.com/772204b647bb8089ed2017718cc4afdeac1d80d1/content/test/data/gpu/pixel_offscreenCanvas_2d_commit_main.html [modify] https://crrev.com/772204b647bb8089ed2017718cc4afdeac1d80d1/content/test/data/gpu/pixel_offscreenCanvas_2d_commit_worker.html [modify] https://crrev.com/772204b647bb8089ed2017718cc4afdeac1d80d1/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html [modify] https://crrev.com/772204b647bb8089ed2017718cc4afdeac1d80d1/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html [modify] https://crrev.com/772204b647bb8089ed2017718cc4afdeac1d80d1/content/test/gpu/gpu_tests/pixel_test_pages.py
,
Mar 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f2cdf4645352446d423e8b7c286870bcb7d00797 commit f2cdf4645352446d423e8b7c286870bcb7d00797 Author: xlai <xlai@chromium.org> Date: Wed Mar 29 16:52:48 2017 Remove failed entries in gpu pixel expectations TBR=zmo@chromium.org TBR_REASON=Updating test expectations after reference images are generated 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.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2777763005 Cr-Commit-Position: refs/heads/master@{#460425} [modify] https://crrev.com/f2cdf4645352446d423e8b7c286870bcb7d00797/content/test/gpu/gpu_tests/pixel_expectations.py
,
Mar 30 2017
There are still test rect dimension issue of these gpu pixel tests on Nexus 5 but the solution is simply to shrink the size. Moved to https://bugs.chromium.org/p/chromium/issues/detail?id=706647 as a separate issue then. |
||
►
Sign in to add a comment |
||
Comment 1 by junov@chromium.org
, Mar 23 2017