1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #define VECS_PER_SPECIFIC_BRUSH 1
7 #include shared,prim_shared,brush
9 flat varying mediump vec4 v_color;
11 #ifdef WR_VERTEX_SHADER
17 SolidBrush fetch_solid_primitive(int address) {
18 vec4 data = fetch_from_gpu_cache_1(address);
19 return SolidBrush(data);
25 RectWithEndpoint local_rect,
26 RectWithEndpoint segment_rect,
28 int specific_resource_address,
34 SolidBrush prim = fetch_solid_primitive(prim_address);
36 float opacity = float(prim_user_data.x) / 65535.0;
37 v_color = prim.color * opacity;
41 #ifdef WR_FRAGMENT_SHADER
44 #ifdef WR_FEATURE_ALPHA_PASS
45 color *= antialias_brush();
47 return Fragment(color);
50 #if defined(SWGL_DRAW_SPAN) && (!defined(WR_FEATURE_ALPHA_PASS) || !defined(WR_FEATURE_DUAL_SOURCE_BLENDING))
51 void swgl_drawSpanRGBA8() {
52 swgl_commitSolidRGBA8(v_color);
55 void swgl_drawSpanR8() {
56 swgl_commitSolidR8(v_color.x);