diff options
Diffstat (limited to 'gfx/wr/webrender/res/ps_quad_textured.glsl')
-rw-r--r-- | gfx/wr/webrender/res/ps_quad_textured.glsl | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/gfx/wr/webrender/res/ps_quad_textured.glsl b/gfx/wr/webrender/res/ps_quad_textured.glsl index 2382623cdb..b405ccac2c 100644 --- a/gfx/wr/webrender/res/ps_quad_textured.glsl +++ b/gfx/wr/webrender/res/ps_quad_textured.glsl @@ -6,30 +6,8 @@ #include ps_quad -#ifndef SWGL_ANTIALIAS -varying highp vec2 vLocalPos; -#endif - #ifdef WR_VERTEX_SHADER -void main(void) { - PrimitiveInfo info = ps_quad_main(); - -#ifndef SWGL_ANTIALIAS - RectWithEndpoint xf_bounds = RectWithEndpoint( - max(info.local_prim_rect.p0, info.local_clip_rect.p0), - min(info.local_prim_rect.p1, info.local_clip_rect.p1) - ); - vTransformBounds = vec4(xf_bounds.p0, xf_bounds.p1); - - vLocalPos = info.local_pos; - - if (info.edge_flags == 0) { - v_flags.x = 0; - } else { - v_flags.x = 1; - } -#endif - +void pattern_vertex(PrimitiveInfo info) { if ((info.quad_flags & QF_SAMPLE_AS_MASK) != 0) { v_flags.z = 1; } else { @@ -39,16 +17,7 @@ void main(void) { #endif #ifdef WR_FRAGMENT_SHADER -void main(void) { - vec4 color = v_color; - -#ifndef SWGL_ANTIALIAS - if (v_flags.x != 0) { - float alpha = init_transform_fs(vLocalPos); - color *= alpha; - } -#endif - +vec4 pattern_fragment(vec4 color) { if (v_flags.y != 0) { vec2 uv = clamp(v_uv, v_uv_sample_bounds.xy, v_uv_sample_bounds.zw); vec4 texel = TEX_SAMPLE(sColor0, uv); @@ -58,7 +27,7 @@ void main(void) { color *= texel; } - oFragColor = color; + return color; } #if defined(SWGL_DRAW_SPAN) |