This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
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.
@jfirebaugh discovered in #8751 that we are using undefined behavior in the
fill_outline
shader: https://github.com/mapbox/mapbox-gl-js/blob/c0dcee76ed5c7d0559bf271ed85692b1b81c654c/src/shaders/fill_outline.fragment.glsl#L11It seems that some implementations correctly interpolate between 1.0 and 0.0 based on the
t
value, but per the spec, it's undefined behavior.It also fixes outline rendering, which has regressed at some point.
Current behavior when drawing an outline with a color different from the fill color:
New (and correct) behavior:
We are drawing outlines as antialiased
GL_LINES
around the polygon. When the color is identical to the fill color, we are clipping the outline at the polygon bounds (see first image), but we can't do that when the color is different. Therefore, we either render the fill below or above the line. At some point, this regressed into rendering it always below (and in this case, it's clipped/covered by the fill).