Skip to content

Commit

Permalink
Auto merge of #14074 - glennw:shader-hot-fix, r=pcwalton
Browse files Browse the repository at this point in the history
Manually copy across a shader fix from WR.

This fix has landed in WR, but WR can't be updated right now, due
to a scroll change landing in WR without the Servo PR being ready
quite yet.

Fixes #14061.
Fixes #14073.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14074)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Nov 5, 2016
2 parents 2b4a7b0 + d62e14f commit 516be8f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions resources/shaders/ps_image_clip.vs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,9 @@ void main(void) {
write_clip(clip);

// vUv will contain how many times this image has wrapped around the image size.
vec2 st0 = image.st_rect.xy;
vec2 st1 = image.st_rect.zw;

if (image.has_pixel_coords) {
vec2 texture_size = vec2(textureSize(sDiffuse, 0));
st0 /= texture_size;
st1 /= texture_size;
}
vec2 texture_size = vec2(textureSize(sDiffuse, 0));
vec2 st0 = image.st_rect.xy / texture_size;
vec2 st1 = image.st_rect.zw / texture_size;

vTextureSize = st1 - st0;
vTextureOffset = st0;
Expand Down

0 comments on commit 516be8f

Please sign in to comment.