Add a capability to recycle DataSourceSurface allocated in CanvasTranslator::LookupSourceSurfaceFromSurfaceDescriptor() if possible
Categories
(Core :: Graphics: Canvas2D, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox128 | --- | fixed |
People
(Reporter: sotaro, Assigned: sotaro)
References
Details
Attachments
(1 external file)
During working for Bug 1899231, allocating DataSourceSurface in BufferTextureHost::GetAsSurface() is a bottle neck during canvas2dvideo with Firefox Profiler on Linux.
- https://profiler.firefox.com/from-url/https%3A%2F%2Ffirefox-ci-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2Fa8jLSE-DTp-5_Kkldq9nxw%2Fruns%2F0%2Fartifacts%2Fpublic%2Ftest_info%2Fprofile_webgl.zip/calltree/?v=10
- https://profiler.firefox.com/from-url/https%3A%2F%2Ffirefox-ci-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2Fa8jLSE-DTp-5_Kkldq9nxw%2Fruns%2F0%2Fartifacts%2Fpublic%2Ftest_info%2Fprofile_webgl.zip/calltree/?file=profile_canvas2dvideo%2Fbenchmarks_video_video_upload.html_pagecycle_1%2Fcycle_0.profile&globalTrackOrder=a0w9&hiddenGlobalTracks=1w3&hiddenLocalTracksByPid=3089-01~3253-0~3174-0~3271-0&range=1614m218&thread=3&v=10
Then it seems better to recycle DataSourceSurface.
| Assignee | ||
Comment 1•2 years ago
|
||
DataSourceSurface allocated in CanvasTranslator::LookupSourceSurfaceFromSurfaceDescriptor() is released soon in RecordedDrawSurfaceDescriptor::PlayEvent().
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
| Assignee | ||
Comment 3•2 years ago
•
|
||
With default gecko, Firefox profiler with canvas2dvideo.
- canvas2dvideo profile on Linux
- canvas2dvideo profile on MacOS
Both on Linux and on MacOS, 100% CPU was used on CanvasRenderer thread.
| Assignee | ||
Comment 4•2 years ago
•
|
||
deleted
Updated•2 years ago
|
Comment 6•2 years ago
|
||
| Assignee | ||
Comment 7•2 years ago
|
||
Hmm, timing change seemed to cause the problem.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 8•2 years ago
|
||
Going to disable the recycling by pref for now.
Updated•2 years ago
|
Comment 10•2 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 11•2 years ago
|
||
The problem of comment 6 happened because of SharedContextWebgl::DrawRectAccel() implementation.
- https://searchfox.org/mozilla-central/rev/59d854a90e036cfa77f3c5b70c8c6ef1d60ebb98/dom/canvas/DrawTargetWebgl.cpp#2412
- https://searchfox.org/mozilla-central/rev/59d854a90e036cfa77f3c5b70c8c6ef1d60ebb98/dom/canvas/DrawTargetWebgl.cpp#2544
When aForceUpdate is not set, recycled DataSourceSurface data is not uploaded to texture.
And DrawTargetWebgl::DrawSurface(). Does not request force update.
Description
•