Skip to content

Commit

Permalink
Auto merge of #2447 - glennw:fix-webgl, r=kvark
Browse files Browse the repository at this point in the history
Fix external texture UVs that are inverted with image brush shader.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/2447)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Feb 21, 2018
2 parents c777875 + 5b73194 commit c395bd9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webrender/res/brush_image.glsl
Expand Up @@ -40,7 +40,12 @@ void brush_vs(
vUv.xy = mix(uv0, uv1, f);
vUv.xy /= texture_size;

vUvBounds = vec4(uv0 + vec2(0.5), uv1 - vec2(0.5)) / texture_size.xyxy;
// Handle case where the UV coords are inverted (e.g. from an
// external image).
vUvBounds = vec4(
min(uv0, uv1) + vec2(0.5),
max(uv0, uv1) - vec2(0.5)
) / texture_size.xyxy;

#ifdef WR_FEATURE_ALPHA_PASS
vLocalPos = vi.local_pos;
Expand Down

0 comments on commit c395bd9

Please sign in to comment.