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

premultiply canvas images when updating texture #7309

Merged
merged 2 commits into from
Sep 21, 2018
Merged

premultiply canvas images when updating texture #7309

merged 2 commits into from
Sep 21, 2018

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Sep 20, 2018

Fix #7302 by premultiplying canvas images when updating their textures.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • [] document any changes to public APIs
  • [] post benchmark scores
  • manually test the debug page
  • [] tagged @mapbox/studio and/or @mapbox/maps-design if this PR includes style spec changes

@ansis
Copy link
Contributor Author

ansis commented Sep 20, 2018

I added some render tests that fake canvases using images so that I could add a regression test for this. The approach taken to fake the canvas isn't great but I couldn't think of a better approach.

@ryanhamley
Copy link
Contributor

Awesome! Looks good to me. Can you just explain to me real quick why the texture.bind and gl.texSubImage2D calls aren't necessary anymore?

@ansis
Copy link
Contributor Author

ansis commented Sep 21, 2018

Can you just explain to me real quick why the texture.bind and gl.texSubImage2D calls aren't necessary anymore?

The call to texture.update(...) contains a gl.texSubImage2D. The other bind calls... I'm not sure that we needed them before. I'm guessing the might be left over from previous refactoring

@ansis ansis merged commit 575ddac into master Sep 21, 2018
@mourner mourner deleted the fix-7302 branch August 1, 2019 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants