Repository navigation
Conversation
mourner
reviewed
Mar 2, 2018
|
|
||
| defines() { | ||
| return [`#define HAS_UNIFORM_u_${this.name}`]; | ||
| return this.names.map((name) => { return `#define HAS_UNIFORM_u_${name}`; }); |
Member
There was a problem hiding this comment.
Nit: you can omit braces and return here.
| } else { | ||
| gl.uniform1f(program.uniforms[`u_${name}`], value); | ||
| } | ||
| }); |
Member
There was a problem hiding this comment.
Nit: let's avoid using forEach and closures in favor of a for .. of loop.
| components: type === 'color' ? 2 : 1, | ||
| offset: 0 | ||
| }; | ||
| }); |
Member
There was a problem hiding this comment.
Nit: you can omit braces and return here too if you surround the object with (...).
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactor is necessary for #2732 because
*-patternproperties are cross-faded and require more data to be passed to the shaders – the x,y coordinates of the top-left and bottom-right corners of up to four icons in an image_atlas, and the pixel ratio of the atlas – that can be packed in onevec4attribute.I added a function that takes a
propertyandtypeand returns thePaintVertexArrayconstructor for the layout needed for that property/type/expression type. This is where we will be able to add exceptions to the default paint vertex array layouts for properties with multiple attributes.I haven't settled on a good way to extend the
populatePaintArraysfunctionality to accommodate special cases yet, but it might make sense to work that out in the follow up PR implementingline-patternproperty functions.Launch Checklist