Bug 1857841 - pt 3. Add a new page kind named "fresh" r=glandium
[gecko.git] / gfx / wr / webrender / res / cs_fast_linear_gradient.glsl
blob36b3368dfe4cc3667f9ec54e7f582e46cb2e38b5
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 #include shared
7 varying highp float vPos;
8 flat varying mediump vec4 vColor0;
9 flat varying mediump vec4 vColor1;
11 #ifdef WR_VERTEX_SHADER
13 PER_INSTANCE in vec4 aTaskRect;
14 PER_INSTANCE in vec4 aColor0;
15 PER_INSTANCE in vec4 aColor1;
16 PER_INSTANCE in float aAxisSelect;
18 void main(void) {
19     vPos = mix(0.0, 1.0, mix(aPosition.x, aPosition.y, aAxisSelect));
21     vColor0 = aColor0;
22     vColor1 = aColor1;
24     gl_Position = uTransform * vec4(mix(aTaskRect.xy, aTaskRect.zw, aPosition.xy), 0.0, 1.0);
26 #endif
28 #ifdef WR_FRAGMENT_SHADER
29 void main(void) {
30     oFragColor = mix(vColor0, vColor1, vPos);
32 #endif