Fix Firefox "Alpha-premult deprecated for non-DOM uploads" warning (#2030)#7128
Fix Firefox "Alpha-premult deprecated for non-DOM uploads" warning (#2030)#7128birkskyum merged 5 commits intomaplibre:mainfrom
Conversation
| expect(texture.texture).toBe(originalHandle); | ||
| }); | ||
|
|
||
| test('premultiplyAlpha produces correct output', () => { |
There was a problem hiding this comment.
This test needs to be next to its method, in image.test.ts or something...
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7128 +/- ##
==========================================
+ Coverage 92.35% 92.63% +0.27%
==========================================
Files 289 289
Lines 24017 24044 +27
Branches 5087 5089 +2
==========================================
+ Hits 22181 22272 +91
+ Misses 1836 1772 -64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for this PR! |
|
As far as I can tell it should be fine. Firefox only optimizes the CPU path we're now using (JS premult), so they benefit. For Chrome, I ran the Paint benchmark comparing main vs this branch: This branch is actually 3.4% faster (9.50ms vs 9.83ms) - ran it again and saw 2.9% improvement Why minimal impact:
|

Firefox logs a warning every time we ask WebGL to handle alpha premultiplication for raw pixel data (sprite atlases, color ramps, etc). It only wants us to use that WebGL flag for actual DOM elements like images and canvases For raw byte arrays, it expects us to do it ourselves.
This moves premultiplication into JS for raw data uploads, keeping the WebGL path for DOM elements.
Fixes #2030
Before
After

Launch Checklist
CHANGELOG.mdunder the## mainsection.