2017-02-06 19:42:52 +03:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
void main(void) {
|
2017-02-14 21:34:14 +03:00
|
|
|
vec2 tc = clamp(vUv, vUvBorder.xy, vUvBorder.zw);
|
2017-02-06 19:42:52 +03:00
|
|
|
#ifdef WR_FEATURE_SUBPIXEL_AA
|
|
|
|
//note: the blend mode is not compatible with clipping
|
2017-02-14 21:34:14 +03:00
|
|
|
oFragColor = texture(sColor0, tc);
|
2017-02-06 19:42:52 +03:00
|
|
|
#else
|
2017-02-14 21:34:14 +03:00
|
|
|
float alpha = texture(sColor0, tc).a;
|
2017-02-06 19:42:52 +03:00
|
|
|
#ifdef WR_FEATURE_TRANSFORM
|
|
|
|
float a = 0.0;
|
|
|
|
init_transform_fs(vLocalPos, vLocalRect, a);
|
|
|
|
alpha *= a;
|
|
|
|
#endif
|
|
|
|
vec4 color = vColor;
|
|
|
|
alpha = min(alpha, do_clip());
|
|
|
|
oFragColor = vec4(vColor.rgb, vColor.a * alpha);
|
|
|
|
#endif
|
|
|
|
}
|