~zsombi/ubuntu-ui-toolkit/fixThemingFallback

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/shaders/shape.frag

[UbuntuShape] Workaround Adreno 320's shader compiler bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        // Get the anti-aliased and resolution independent shape mask using distance fields.
92
92
        lowp float distanceMin = abs(dist) * -distanceAA + 0.5;
93
93
        lowp float distanceMax = abs(dist) * distanceAA + 0.5;
94
 
        lowp float mask = smoothstep(distanceMin, distanceMax, shapeData[yCoord <= 0.0 ? 0 : 1]);
 
94
        lowp int shapeSide = yCoord <= 0.0 ? 0 : 1;
 
95
        lowp float mask = smoothstep(distanceMin, distanceMax, shapeData[shapeSide]);
95
96
        // Get the shadow color outside of the shape mask.
96
97
        lowp float shadow = (shapeData.b * -mask) + shapeData.b;  // -ab + a = a(1 - b)
97
98
        // Mask the current color then blend the shadow over the resulting color. We simply use