summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-06-02 17:48:03 +0900
committerTor Lillqvist <tml@collabora.com>2016-06-02 09:16:05 +0000
commit5888dd3e521184637cbe70757262eaf83e20387c (patch)
tree0b526874db5bedb4a272e91e7834e8b4bbf7f595
parentd44dea9e43c0f9d3b4bada800b1f94a48728f443 (diff)
tdf#100187 fix division by zero in comboFragmentShader
When feather is 0.0 (used when anti-aliasing is disabled) then we get a "division by zero" situation. As per OpenGL secs. the shader should not fail in this situation however the result is undetermined. Most GPUs handled this correctly but on some the lines didn't draw at all. This should fix this issue. Change-Id: I56ca2f10c393491807321969c72085ef7690d16a (cherry picked from commit 7aae883b90850af3f3a0aaada5704682f77c3d02) Reviewed-on: https://gerrit.libreoffice.org/25809 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--vcl/opengl/combinedFragmentShader.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/opengl/combinedFragmentShader.glsl b/vcl/opengl/combinedFragmentShader.glsl
index c44e75c09373..8d73d0861f87 100644
--- a/vcl/opengl/combinedFragmentShader.glsl
+++ b/vcl/opengl/combinedFragmentShader.glsl
@@ -29,7 +29,7 @@ void main()
// Calculate the multiplier so we can transform the 0->1 fade factor
// to take feather and line width into account.
- float multiplied = 1.0 / (1.0 - (start / end));
+ float multiplied = start == end ? 1.0 : 1.0 / (1.0 - (start / end));
float dist = (1.0 - abs(fade_factor)) * multiplied;