Skip to content

Commit

Permalink
Update WebRender to get necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrobinson committed Nov 7, 2016
1 parent ef82d77 commit dea0c7c
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions components/servo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions resources/shaders/clip_shared.glsl
Expand Up @@ -9,16 +9,16 @@ flat varying vec4 vClipMaskUvRect;
flat varying vec4 vClipMaskLocalRect;

#ifdef WR_VERTEX_SHADER
void write_clip(ClipInfo clip) {
void write_clip(ClipData clip) {
vClipRect = vec4(clip.rect.rect.xy, clip.rect.rect.xy + clip.rect.rect.zw);
vClipRadius = vec4(clip.top_left.outer_inner_radius.x,
clip.top_right.outer_inner_radius.x,
clip.bottom_right.outer_inner_radius.x,
clip.bottom_left.outer_inner_radius.x);
//TODO: interpolate the final mask UV
vec2 texture_size = textureSize(sMask, 0);
vClipMaskUvRect = clip.mask_info.uv_rect / texture_size.xyxy;
vClipMaskLocalRect = clip.mask_info.local_rect; //TODO: transform
vClipMaskUvRect = clip.mask_data.uv_rect / texture_size.xyxy;
vClipMaskLocalRect = clip.mask_data.local_rect; //TODO: transform
}
#endif

Expand Down
16 changes: 8 additions & 8 deletions resources/shaders/prim_shared.glsl
Expand Up @@ -347,13 +347,13 @@ ClipRect fetch_clip_rect(int index) {
return rect;
}

struct ImageMaskInfo {
struct ImageMaskData {
vec4 uv_rect;
vec4 local_rect;
};

ImageMaskInfo fetch_mask_info(int index) {
ImageMaskInfo info;
ImageMaskData fetch_mask_data(int index) {
ImageMaskData info;

ivec2 uv = get_fetch_uv_2(index);

Expand All @@ -379,24 +379,24 @@ ClipCorner fetch_clip_corner(int index) {
return corner;
}

struct ClipInfo {
struct ClipData {
ClipRect rect;
ClipCorner top_left;
ClipCorner top_right;
ClipCorner bottom_left;
ClipCorner bottom_right;
ImageMaskInfo mask_info;
ImageMaskData mask_data;
};

ClipInfo fetch_clip(int index) {
ClipInfo clip;
ClipData fetch_clip(int index) {
ClipData clip;

clip.rect = fetch_clip_rect(index + 0);
clip.top_left = fetch_clip_corner(index + 1);
clip.top_right = fetch_clip_corner(index + 2);
clip.bottom_left = fetch_clip_corner(index + 3);
clip.bottom_right = fetch_clip_corner(index + 4);
clip.mask_info = fetch_mask_info(index + 5);
clip.mask_data = fetch_mask_data(index + 5);

return clip;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/shaders/ps_gradient_clip.vs.glsl
Expand Up @@ -66,6 +66,6 @@ void main(void) {
break;
}

ClipInfo clip = fetch_clip(prim.clip_index);
ClipData clip = fetch_clip(prim.clip_index);
write_clip(clip);
}
2 changes: 1 addition & 1 deletion resources/shaders/ps_image_clip.vs.glsl
Expand Up @@ -23,7 +23,7 @@ void main(void) {
vLocalPos = vi.local_clamped_pos;
#endif

ClipInfo clip = fetch_clip(prim.clip_index);
ClipData clip = fetch_clip(prim.clip_index);
write_clip(clip);

// vUv will contain how many times this image has wrapped around the image size.
Expand Down
2 changes: 1 addition & 1 deletion resources/shaders/ps_rectangle_clip.vs.glsl
Expand Up @@ -22,6 +22,6 @@ void main(void) {
vPos = vi.local_clamped_pos;
#endif

ClipInfo clip = fetch_clip(prim.clip_index);
ClipData clip = fetch_clip(prim.clip_index);
write_clip(clip);
}

0 comments on commit dea0c7c

Please sign in to comment.