Use multiple shmems for remote canvas recording and translation.
Categories
(Core :: Graphics: Canvas2D, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: bobowen, Assigned: bobowen)
References
(Blocks 1 open bug, Regressed 2 open bugs)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
This change has been broken out from bug 1850775, as we may not need to land the other parts.
It changes the recording and playback of remote canvas 2D drawing to use multiple shmems instead of a single ring buffer.
A default size of buffer is used and recycled. If a drawing event will not fit inside a default buffer a one off buffer is created.
A single buffer large enough for the largest canvas is created and reused for readback, this appears sufficient, because generally when the canvas code needs a DataSourceSurface
it is used immediately then released.
Assignee | ||
Comment 1•1 year ago
|
||
This replaces the use of a single large ring buffer.
The buffers are still processed in parallel and are recycled to reduce
allocation. Events that do not fit in the default sized buffer have a separate
buffer created to fit them. These large buffers are not recycled.
Separate shared memory is used for readback, with a single shmem cached for this
purpose. Generally only one cached shmem should be required, because the
operations that usually readback the data do it straight away.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Comment 4•11 months ago
|
||
Backed out for causing bustage on CanvasDrawEventRecorder.h
- backout: https://hg.mozilla.org/integration/autoland/rev/e4ce39ecb37c9f591687cdcbf6014c04e3307cf4
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=HaZIjx52SfWo0pL2UU7pdg.0&revision=2b56c2b2837adfd7c49b599771cfea2d9e3d687b
- failure log: https://treeherder.mozilla.org/logviewer?job_id=437274469&repo=autoland&lineNumber=43099
[task 2023-11-22T14:01:51.411Z] 14:01:51 INFO - In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/layers/CanvasTranslator.h:16,
[task 2023-11-22T14:01:51.412Z] 14:01:51 INFO - from /builds/worker/checkouts/gecko/gfx/ipc/CanvasManagerParent.cpp:14,
[task 2023-11-22T14:01:51.412Z] 14:01:51 INFO - from Unified_cpp_gfx_ipc0.cpp:11:
[task 2023-11-22T14:01:51.413Z] 14:01:51 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/layers/CanvasDrawEventRecorder.h:60:25: error: member 'mozilla::Atomic<long int> mozilla::layers::CanvasDrawEventRecorder::Header::<unnamed union>::<unnamed struct>::eventCount' with constructor not allowed in anonymous aggregate
[task 2023-11-22T14:01:51.413Z] 14:01:51 INFO - Atomic<int64_t> eventCount;
[task 2023-11-22T14:01:51.413Z] 14:01:51 INFO - ^~~~~~~~~~
[task 2023-11-22T14:01:51.413Z] 14:01:51 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/layers/CanvasDrawEventRecorder.h:61:25: error: member 'mozilla::Atomic<long int> mozilla::layers::CanvasDrawEventRecorder::Header::<unnamed union>::<unnamed struct>::writerWaitCount' with constructor not allowed in anonymous aggregate
[task 2023-11-22T14:01:51.414Z] 14:01:51 INFO - Atomic<int64_t> writerWaitCount;
[task 2023-11-22T14:01:51.414Z] 14:01:51 INFO - ^~~~~~~~~~~~~~~
[task 2023-11-22T14:01:51.414Z] 14:01:51 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/layers/CanvasDrawEventRecorder.h:62:23: error: member 'mozilla::Atomic<mozilla::layers::CanvasDrawEventRecorder::State> mozilla::layers::CanvasDrawEventRecorder::Header::<unnamed union>::<unnamed struct>::writerState' with constructor not allowed in anonymous aggregate
[task 2023-11-22T14:01:51.415Z] 14:01:51 INFO - Atomic<State> writerState;
[task 2023-11-22T14:01:51.415Z] 14:01:51 INFO - ^~~~~~~~~~~
Comment 5•11 months ago
|
||
Comment 6•11 months ago
|
||
We are seeing an issue in bug 1829026 where I believe (based on printf debugging) the reader is waiting to read because it has an incomplete recorded object, and the writer is waiting for the buffer to be drained. We see the recording bail with a bad stream as a result of the timeouts. I am not certain but I believe we are hitting this path to write a partial object:
https://searchfox.org/mozilla-central/rev/16526d690cccc9c60cacf09cc08e2c3041ef884e/gfx/2d/RecordedEvent.h#249
In theory the patch in this bug should resolve that because it no longer writes partial objects:
https://hg.mozilla.org/integration/autoland/rev/2b56c2b2837a#l4.82
Assignee | ||
Comment 7•11 months ago
|
||
Comment 9•11 months ago
|
||
bugherder |
Comment 10•11 months ago
|
||
Backed out for causing Bug 1868934
Backout link: https://hg.mozilla.org/integration/autoland/rev/3cd52b71681726c3c334b3bc633198f7d68d8c28
Log link: https://treeherder.mozilla.org/logviewer?job_id=439344149&repo=autoland&lineNumber=107262
Comment 11•11 months ago
|
||
Assignee | ||
Updated•11 months ago
|
Comment 12•11 months ago
|
||
Comment 13•11 months ago
|
||
bugherder |
Updated•11 months ago
|
Description
•