gecko-dev/gfx/webrender/res/brush_solid.glsl
Kartikaya Gupta c6b419d0eb Bug 1457891 - Update webrender to commit 8da531dc2cd77a4dadbfe632b04e76454f51ac9f. r=jrmuizel
MozReview-Commit-ID: HTqjYp9gFwA

--HG--
extra : rebase_source : 184b9afc8834819c7bace70ea51d81642d2e17ff
2018-05-03 09:00:55 -04:00

55 lines
1.1 KiB
GLSL

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#define VECS_PER_SPECIFIC_BRUSH 1
#include shared,prim_shared,brush
flat varying vec4 vColor;
#ifdef WR_FEATURE_ALPHA_PASS
varying vec2 vLocalPos;
#endif
#ifdef WR_VERTEX_SHADER
struct SolidBrush {
vec4 color;
};
SolidBrush fetch_solid_primitive(int address) {
vec4 data = fetch_from_resource_cache_1(address);
return SolidBrush(data);
}
void brush_vs(
VertexInfo vi,
int prim_address,
RectWithSize local_rect,
RectWithSize segment_rect,
ivec3 user_data,
mat4 transform,
PictureTask pic_task,
int brush_flags,
vec4 unused
) {
SolidBrush prim = fetch_solid_primitive(prim_address);
vColor = prim.color;
#ifdef WR_FEATURE_ALPHA_PASS
vLocalPos = vi.local_pos;
#endif
}
#endif
#ifdef WR_FRAGMENT_SHADER
Fragment brush_fs() {
vec4 color = vColor;
#ifdef WR_FEATURE_ALPHA_PASS
color *= init_transform_fs(vLocalPos);
#endif
return Fragment(color);
}
#endif