forked from joejulian/gio
ui/app/internal/gpu: fix stenciling on the iOS simulator
It seems that the iOS simulator can return NaN from texture2D, so even though width == 0, the resulting cover is not. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -503,7 +503,10 @@ void main() {
|
||||
// around dy = 0. Scale slope with extent width.
|
||||
float areav = abs(dy*width)/16.0;
|
||||
// Look up coverage from y and slope and scale to extent.
|
||||
gl_FragColor.r = texture2D(areaLUT, vec2(areau, areav)).r*width;
|
||||
float cover = texture2D(areaLUT, vec2(areau, areav)).r*width;
|
||||
if (width == 0.0)
|
||||
cover = 0.0; // Needed on the iOS simulator.
|
||||
gl_FragColor.r = cover;
|
||||
}
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user