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

Remove redundant check for state.atlasTextureIcon in drawLayerSymbols #10038

Closed
wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 17, 2020

This removes a redundant check in drawLayerSymbols.
We already check for state.atlasTextureIcon in line 367, and (unless I'm missing something) it shouldn't have changed by line 369.


(It would be nice if you can tag this PR for hacktoberfest inclusion as described in https://hacktoberfest.digitalocean.com/details#rules - feel free to ignore this last bit if you don't want this)

@ryanhamley
Copy link
Contributor

This double check was added in #8904 specifically https://github.com/mapbox/mapbox-gl-js/pull/8904/files#diff-32491b8d513a9d3eb4a65cd5b5ded4b70be4f2cea814adbc54f437eaccf1af0cR367-R372 so I don't believe it's an oversight. Changing the activeTexture may update state.atlasTextureIcon. @alexshalamov can you confirm that?

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.

Good catch!

Changing the activeTexture may update state.atlasTextureIcon.

@ryanhamley there's no chance for that, it will only set the active texture binder in the webgl context, no side effect involved.

@@ -366,9 +366,7 @@ function drawLayerSymbols(painter, sourceCache, layer, coords, isText, translate
state.atlasTexture.bind(state.atlasInterpolation, gl.CLAMP_TO_EDGE);
if (state.atlasTextureIcon) {
context.activeTexture.set(gl.TEXTURE1);
if (state.atlasTextureIcon) {
Copy link
Author

Choose a reason for hiding this comment

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

Was this meant to check atlasInterpolationIcon maybe?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ryanhamley
Copy link
Contributor

ryanhamley commented Jan 12, 2021

@JannikGM If you'd still like to contribute this, you will need to sign our new Contributor License Agreement. I'm going to close this as stale, but if you sign the CLA, we can re-open it.

@ryanhamley ryanhamley closed this Jan 12, 2021
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.

3 participants