Canvas source not respecting alpha values set on canvas element #7302
Closed
Description
mapbox-gl-js version:
post-v0.49.0 (this bug has not hit a release yet but is reproducible on master
)
browser:
any
Steps to Trigger Behavior
- Draw/render image on a canvas element with some alpha transparency
- Add canvas element to a canvas source
Link to Demonstration
https://codepen.io/rsh412/pen/ZMVNJq?editors=1010#0
Note that this is an example of the canvas source working as expected. I can't get a buggy example to work in JSBin or Codepen because the bug isn't in a release. But at least this shows a testable setup.
Expected Behavior
Canvas source should render alpha transparency set by canvas element
Actual Behavior
Canvas source renders alpha channel with opacity of 1
v0.49.0 (correct alpha opacity)
master (incorrect alpha opacity)
git bisect
points to something in #7039 as the culprit. cc @ansis