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

Issue 2300633004: Allow canvases to be GPU-accelerated in Workers (Closed)

Created:
4 years, 3 months ago by Justin Novosad
Modified:
4 years, 3 months ago
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Rik, f(malita), blink-reviews, piman+watch_chromium.org, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis, xlai (Olivia), xidachen, Stephen White
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow canvases to be GPU-accelerated in Workers This change sets up a per-thread shared GPU context that is managed by a thread-specific singleton SharedGpuContext. This means that all 2D contexts on a given worker will use the same context, which avoids having to rely on mailboxes all the time. Also this CL makes deep changes to AcceleratedStaticBitmapImage in order to support the use of the current thread's shared context, and it handles transfers between threads in order to support the transferrable behavior of ImageBitmap objects. BUG=593514 Committed: https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 Cr-Commit-Position: refs/heads/master@{#416929}

Patch Set 1 #

Total comments: 6

Patch Set 2 : fixes + rebase #

Patch Set 3 : Add test + fix #

Patch Set 4 : rebase #

Patch Set 5 : test expectation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+359 lines, -74 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 1 chunk +1 line, -7 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker.html View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-1.js View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-ImageBitmap-worker-to-worker-2.js View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h View 1 2 3 3 chunks +27 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp View 1 2 3 6 chunks +115 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/Image.h View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp View 1 2 3 3 chunks +10 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp View 1 2 3 2 chunks +1 line, -3 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h View 1 chunk +49 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp View 1 chunk +103 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (30 generated)
Justin Novosad
PTAL
4 years, 3 months ago (2016-08-31 21:36:46 UTC) #4
Stephen White
https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp File third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp (right): https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp#newcode33 third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp:33: return adoptRef(new AcceleratedStaticBitmapImage(image, std::move(grContext), mailbox, syncToken)); Note: now calling ...
4 years, 3 months ago (2016-09-01 15:43:54 UTC) #11
haraken
https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp File third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp (right): https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp#newcode18 third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp:18: DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<SharedGpuContext>, threadSpecificInstance, new ThreadSpecific<SharedGpuContext>); On 2016/09/01 15:43:54, Stephen White ...
4 years, 3 months ago (2016-09-01 17:33:05 UTC) #13
Justin Novosad
On 2016/09/01 17:33:05, haraken wrote: > https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp > File third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp > (right): > > https://codereview.chromium.org/2300633004/diff/1/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.cpp#newcode18 ...
4 years, 3 months ago (2016-09-01 18:15:00 UTC) #14
haraken
On 2016/09/01 18:15:00, Justin Novosad wrote: > On 2016/09/01 17:33:05, haraken wrote: > > > ...
4 years, 3 months ago (2016-09-01 18:29:36 UTC) #15
Justin Novosad
New patch. Addressed all comments. The additional test actually found bugs. \o/
4 years, 3 months ago (2016-09-02 21:16:56 UTC) #23
Justin Novosad
New patch. rebased
4 years, 3 months ago (2016-09-06 17:19:58 UTC) #26
Justin Novosad
Switching reviewers because senorblanco is OOO @kbr: PTAL
4 years, 3 months ago (2016-09-06 17:50:48 UTC) #28
Ken Russell (switch to Gerrit)
This is awesome. I don't have confidence though in my ability to look at this ...
4 years, 3 months ago (2016-09-07 04:20:43 UTC) #36
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/2300633004/80001
4 years, 3 months ago (2016-09-07 13:55:42 UTC) #38
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-07 14:00:00 UTC) #40
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/83ac5ff37da4ea1c6d052649ccea46dd4bd453d6 Cr-Commit-Position: refs/heads/master@{#416929}
4 years, 3 months ago (2016-09-07 14:01:31 UTC) #42
lushnikov
4 years, 3 months ago (2016-09-08 00:13:14 UTC) #43
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/2323573002/ by lushnikov@chromium.org.

The reason for reverting is: This makes the following tests fail on Linux MSAN
bot:

virtual/gpu/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html
virtual/display_list_2d_canvas/fast/canvas/canvas-createImageBitmap-invalid-blob-in-workers.html

Build link:
https://uberchromegw.corp.google.com/i/chromium.webkit/builders/WebKit%20Linu...

.

Powered by Google App Engine
This is Rietveld 408576698