Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ImageSource not working in FF/Safari #10230

Merged
merged 1 commit into from
Dec 19, 2020
Merged

Fix ImageSource not working in FF/Safari #10230

merged 1 commit into from
Dec 19, 2020

Conversation

mourner
Copy link
Member

@mourner mourner commented Dec 18, 2020

Closes #10226. Closes #10230. Turns out that since Safari/FF don't support offscreen canvas, ImageSource uses the old blob url image loading hack, however the image isn't bound to a GL texture immediately because this is deferred to a separate prepare step. This leads to image sources trying to upload an image to GL that was already reset.

This is a hacky workaround — wait until the next frame before releasing the image, so that prepare passes can happen before. But it may be fragile — we should have a hard look at the architecture here and make it more resilient.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix ImageSource not working in some cases in Firefox & Safari.</changelog>

Copy link
Contributor

@karimnaaji karimnaaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't qualify this fix as hacky, it's fairly common to defer cpu resource deletion to a later frame to ensure graphics APIs can still retrieve the data. The concern is whether we are confident that a single frame is enough in that situation, and the fix does indeed work great on both firefox and safari.

@lights0123
Copy link

In the announcement of V2, "Updates to the v1 releases will be made only for critical browser compatibility" is mentioned. Any chance for an emergency backport of this? The entire image source feature is broken in Firefox.

@mourner
Copy link
Member Author

mourner commented Jan 8, 2021

@lights0123 yes, we're planning to do a v1.13 patch release with this fix in a few days.

@ryanhamley ryanhamley mentioned this pull request Feb 17, 2021
@ryanhamley
Copy link
Contributor

@lights0123 we released this as a patch v1.13.1

facebook-github-bot pushed a commit to terragraph/tgnms that referenced this pull request Apr 30, 2021
Summary:
upgrades mapbox to 1.13.1, node bearings were not showing in firefox/safari presumably due to:
mapbox/mapbox-gl-js#10230

allow-large-files

Reviewed By: cjminer505

Differential Revision: D28098026

fbshipit-source-id: 972b3df93f3b471f81c171f588500182e5a40822
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageSource is not shown on Firefox and Safari (v1.13.0, v2.0.0)
4 participants