Make recording based canvases run on DOM workers
Categories
(Core :: Graphics: Canvas2D, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox125 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files, 9 obsolete files)
In bug 1852145, we moved PCanvas to be managed by PCanvasManager. Now in this bug, we will complete the content process side work to make recordings work on DOM worker threads.
Assignee | ||
Comment 1•1 year ago
|
||
This patch adds/updates the thread assertion plumbing for CanvasChild
and DrawEventRecorder to ensure that we are always accessing them on the
owning thread. It also now makes these checks compatible with running in
a DOM worker context for OffscreenCanvas using recordings.
Depends on D189525
Assignee | ||
Comment 2•1 year ago
|
||
This patch allows us to create nsExpirationTracker objects off the main
thread, with the caveat that memory pressure events should/must be
handled directly by the creator rather than managed internally. With
that in mind, the threading assertions have also been updated to ensure
it is always the owning thread that accesses the tracker.
Depends on D189526
Assignee | ||
Comment 3•1 year ago
|
||
This patch adds support for allocationg shmem sections for
ImageBridgeChild. The recording infrastructure depends on it.
Depends on D189527
Assignee | ||
Comment 4•1 year ago
|
||
This patch makes the CanvasManagerChild creates/manager the
ActiveResourceTracker instead of the WebRenderBridgeChild. Since PCanvas
is now managed by PCanvasManager, and ActiveResourceTracker is only used
by the PCanvas recording plumbing, we need it on every thread that the
CanvasManagerChild can be created.
Depends on D189528
Assignee | ||
Comment 5•1 year ago
|
||
Depends on D189529
Assignee | ||
Comment 6•1 year ago
|
||
Depends on D189530
Assignee | ||
Comment 7•1 year ago
|
||
It is disabled in this patch via the gfx.canvas.remote.allow-offscreen
pref. A follow up patch will enable this by default.
Depends on D189531
Updated•1 year ago
|
Updated•1 year ago
|
Comment 8•1 year ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:aosmond, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 10•1 year ago
|
||
Because we cannot control the ordering of shutdown notification from
WorkerRef, we need to choose one centralized point to begin shutdown of
the main thread or the owning DOM worker. Since there are other objects
owned by CanvasManagerChild, we also switch to a ThreadSafeWorkerRef.
Assignee | ||
Comment 11•1 year ago
|
||
If ImageBridgeChild is responsible for the textures being forwarded to
the compositor process, then the callback will happen on
ImageBridgeChild's thread instead of the main or DOM worker thread.
Assignee | ||
Comment 12•1 year ago
|
||
This allows us to create a TextureClient on a different thread than the
actor without special effort on the part of the allocator. Similarly, it
also allows us to destroy a TextureClient on a different thread if it
has a readlock bound to it.
Assignee | ||
Comment 13•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Comment 15•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/711b3f47e380
https://hg.mozilla.org/mozilla-central/rev/4bfa0d4913a2
https://hg.mozilla.org/mozilla-central/rev/13e806495fb8
https://hg.mozilla.org/mozilla-central/rev/2028c7018977
https://hg.mozilla.org/mozilla-central/rev/5b2a89a61f7f
https://hg.mozilla.org/mozilla-central/rev/2061271c53e8
https://hg.mozilla.org/mozilla-central/rev/d4bfe15c07ec
https://hg.mozilla.org/mozilla-central/rev/40cba2c51b1c
https://hg.mozilla.org/mozilla-central/rev/8ed51e7d1c98
https://hg.mozilla.org/mozilla-central/rev/db60743295fb
https://hg.mozilla.org/mozilla-central/rev/7704291111b4
Comment 16•1 year ago
|
||
Backed out 12 changesets (Bug 1795296, Bug 1855742) as requested by aosmond a=backout
Link: https://hg.mozilla.org/mozilla-central/rev/3fd71c45d9fc05e5912ec6c9ba191a9a3a7f2038
Comment 17•1 year ago
|
||
Comment on attachment 9355624 [details]
Bug 1855742 - Part 1. Add/update owning thread assertions to CanvasChild/DrawEventRecorder.
Revision D189526 was moved to bug 1870957. Setting attachment 9355624 [details] to obsolete.
Comment 18•1 year ago
|
||
Comment on attachment 9355625 [details]
Bug 1855742 - Part 2. Allow nsExpirationTracker to be created on any thread.
Revision D189527 was moved to bug 1870957. Setting attachment 9355625 [details] to obsolete.
Comment 19•1 year ago
|
||
Comment on attachment 9355627 [details]
Bug 1855742 - Part 4. Make CanvasManagerChild manage ActiveResourceTracker.
Revision D189529 was moved to bug 1870957. Setting attachment 9355627 [details] to obsolete.
Comment 20•1 year ago
|
||
Comment on attachment 9366318 [details]
Bug 1855742 - Part 5. Refactor canvas shutdown to be synchronized with CanvasManagerChild.
Revision D195120 was moved to bug 1870957. Setting attachment 9366318 [details] to obsolete.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 21•1 year ago
|
||
Comment on attachment 9366322 [details]
Bug 1855742 - Part 4. Make OffscreenCanvas use PersistentBufferProvider on the display pipeline.
Revision D195124 was moved to bug 1870488. Setting attachment 9366322 [details] to obsolete.
Comment 22•1 year ago
|
||
Comment on attachment 9355626 [details]
Bug 1855742 - Part 1. Implement ImageBridgeChild::GetTileLockAllocator.
Revision D189528 was moved to bug 1870488. Setting attachment 9355626 [details] to obsolete.
Comment 23•1 year ago
|
||
Comment on attachment 9366321 [details]
Bug 1855742 - Part 3. Ensure TextureClient's mReadLock is only created on the IPDL actor thread.
Revision D195123 was moved to bug 1870488. Setting attachment 9366321 [details] to obsolete.
Assignee | ||
Comment 24•1 year ago
|
||
This patch makes us block on the DOM worker thread in order to
synchronize properly with canvas 2D recordings when toDataURL and toBlob
are called on an HTMLCanvasElement object which also called
transferControlToOffscreen and transferred it to a DOM worker.
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 25•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 26•1 year ago
|
||
Comment 27•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f66c5fdebb25
https://hg.mozilla.org/mozilla-central/rev/58bcf426c7f9
https://hg.mozilla.org/mozilla-central/rev/b495e60e1b81
https://hg.mozilla.org/mozilla-central/rev/008b68c8dccf
Description
•