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

textImage2D does not accept OffscreenCanvas anymore as a pixel source for texture #1180

Open
obiot opened this issue Mar 30, 2023 · 0 comments
Labels

Comments

@obiot
Copy link
Member

obiot commented Mar 30, 2023

Describe the bug
Since the last macOS and Safari version, textImage2D does not accept OffscreenCanvas anymore as a pixel source for texture. Passing directly a OffscreenCanvas element will throw a Type Error exception.

Device:

  • OS: macOS 13.3
  • Browser: Safari 16.4
  • melonJS Version: 14.0 and higher

Solution
This was fixed in the 15.1 release by using transfertToBitmapImage() when the pixels source is an Offscreen Canvas.

Unfortunately, that led to another issue when using Offscreencanvas and system font rendering in WebGL, with the converted BitmapImage producing some garbaged pixel soup :
Screenshot 2023-03-30 at 10 28 13 AM

Internal use of OffscreenCanvas when rendering text was then also disabled in the same fix, to restore the previous behaviour :
Screenshot 2023-03-30 at 10 28 41 AM

In conclusion, the issue is fixed for now, but I'm creating this issue, because I'm not sure if this is actually the expected behaviour as per the W3C/WebGL standard or a bug with the current version of Safari (other browsers are still fine with using OffscreenCanvas as a pixel source).

If anyone has any additional insight on this, I'm definitely interested !

@obiot obiot added the Bug label Mar 30, 2023
@obiot obiot changed the title textImage2D does not accept OffscreenCanvas anymore as a pixel source for the texture textImage2D does not accept OffscreenCanvas anymore as a pixel source for texture Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant