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
prim_shared: Fix clip mask perspective interpolation. #3145
Changes from 1 commit
File filter...
Jump to…
prim_shared: Fix clip mask perspective interpolation.
This was really hard to track down, the comment there really convinced me that the code was correct, so I ended up looking at everything else before that... This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1494453.
- Loading branch information
Unverified
| @@ -241,8 +241,7 @@ float do_clip() { | ||
| return 1.0; | ||
| } | ||
| // anything outside of the mask is considered transparent | ||
| //Note: we assume gl_FragCoord.w == interpolated(1 / vClipMaskUv.w) | ||
| vec2 mask_uv = vClipMaskUv.xy * gl_FragCoord.w; | ||
| vec2 mask_uv = vClipMaskUv.xy / vClipMaskUv.w; | ||
emilio
Author
Member
|
||
| bvec2 left = lessThanEqual(vClipMaskUvBounds.xy, mask_uv); // inclusive | ||
| bvec2 right = greaterThan(vClipMaskUvBounds.zw, mask_uv); // non-inclusive | ||
| // bail out if the pixel is outside the valid bounds | ||
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| root: | ||
| items: | ||
| - | ||
| type: stacking-context | ||
| bounds: [0, 0, 0, 0] | ||
| perspective: [1, 0, 0, 0, 0, 1, 0, 0, -300, -250, 1, -0.5, 0, 0, 0, 1] | ||
| items: | ||
| - | ||
| bounds: [0, 0, 0, 0] | ||
| type: stacking-context | ||
| transform: [10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 1, 0, -5382, -3222, -18, 1] | ||
| items: | ||
| - | ||
| bounds: [0, 0, 100, 100] | ||
| type: rect | ||
| color: red | ||
| - | ||
| bounds: [0, 0, 100, 100] | ||
| type: rect | ||
| color: green | ||
| complex-clip: | ||
| rect: [0, 0, 100, 100] | ||
| radius: 16 | ||
|
|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| root: | ||
| items: | ||
| - | ||
| type: stacking-context | ||
| bounds: [0, 0, 0, 0] | ||
| transform: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 139, 0, 1] | ||
| perspective: [1, 0, 0, 0, 0, 1, 0, 0, -299, -250, 1, -0.5, 0, 0, 0, 1] | ||
| items: | ||
| - | ||
| bounds: [0, 0, 0, 0] | ||
| type: stacking-context | ||
| transform: [10, 0, 0, 0, 0, 10, 0, 0, 0, 0, 1, 0, -5382, -3222, -18, 1] | ||
| items: | ||
| - | ||
| type: box-shadow | ||
| bounds: [548, 200, 100, 100] | ||
| color: 0 0 0 0.7020 | ||
| blur-radius: 20 | ||
| - | ||
| bounds: [548, 200, 100, 100] | ||
| type: rect | ||
| color: 0 255 0 1.0000 |
did you figure out why my comment was wrong?