mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Update WebRender to get the latest changes
This commit is contained in:
parent
8a12c15582
commit
0a13c05479
20 changed files with 650 additions and 445 deletions
|
@ -4,35 +4,40 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void) {
|
||||
ImageClip image = fetch_image_clip(gl_InstanceID);
|
||||
Primitive prim = load_primitive(gl_InstanceID);
|
||||
Image image = fetch_image(prim.prim_index);
|
||||
|
||||
#ifdef WR_FEATURE_TRANSFORM
|
||||
TransformVertexInfo vi = write_transform_vertex(image.info);
|
||||
TransformVertexInfo vi = write_transform_vertex(prim.local_rect,
|
||||
prim.local_clip_rect,
|
||||
prim.layer,
|
||||
prim.tile);
|
||||
vLocalRect = vi.clipped_local_rect;
|
||||
vLocalPos = vi.local_pos;
|
||||
#else
|
||||
VertexInfo vi = write_vertex(image.info);
|
||||
VertexInfo vi = write_vertex(prim.local_rect,
|
||||
prim.local_clip_rect,
|
||||
prim.layer,
|
||||
prim.tile);
|
||||
vLocalRect = prim.local_rect;
|
||||
vLocalPos = vi.local_clamped_pos;
|
||||
vLocalRect = image.info.local_rect;
|
||||
#endif
|
||||
|
||||
write_clip(image.clip);
|
||||
Clip clip = fetch_clip(prim.clip_index);
|
||||
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;
|
||||
|
||||
switch (uint(image.uvkind.x)) {
|
||||
case UV_NORMALIZED:
|
||||
break;
|
||||
case UV_PIXEL: {
|
||||
vec2 texture_size = vec2(textureSize(sDiffuse, 0));
|
||||
st0 /= texture_size;
|
||||
st1 /= texture_size;
|
||||
}
|
||||
break;
|
||||
if (image.has_pixel_coords) {
|
||||
vec2 texture_size = vec2(textureSize(sDiffuse, 0));
|
||||
st0 /= texture_size;
|
||||
st1 /= texture_size;
|
||||
}
|
||||
|
||||
vTextureSize = st1 - st0;
|
||||
vTextureOffset = st0;
|
||||
vStretchSize = image.stretch_size_and_tile_spacing.xy;
|
||||
vTileSpacing = image.stretch_size_and_tile_spacing.zw;
|
||||
vStretchSize = image.stretch_size_and_tile_spacing.xy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue