Canvas Source Performance Increase #5448
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A recent fix for GPU related bug introduced a large performance hit to animated canvas sources. The intermediary step of copying data to an
ImageData
object, particularly with large canvases (my use case is 3000x3000), caused an unacceptable frame drop for my users.This PR removes the intermediate step. The result is a dramatic increase in performance, back to 60fps.
I have confirmed that the change works with previously affected broadwell line GPUs referenced here: #4262
contextType
is no longer needed when creating a canvas source.Tests do not need an update since there is not a good way to test rendering at the moment (see #5303).
I appreciate all the effort that was put into confirming and working around the GPU issue when it was first presented. It would seem as though the work around is not needed anymore. I don't know if that's the result of a change somewhere else in the mapbox codebase or something else entirely.
Happy to answer questions.
Launch Checklist
fixes #5301