[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/opengl
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Thu Jun 2 10:38:24 UTC 2016
vcl/opengl/combinedFragmentShader.glsl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit be4aea73266f4aadf561b4b3943206d361a46ebd
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Thu Jun 2 17:48:03 2016 +0900
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.
(cherry picked from commit 7aae883b90850af3f3a0aaada5704682f77c3d02)
Change-Id: I56ca2f10c393491807321969c72085ef7690d16a
Reviewed-on: https://gerrit.libreoffice.org/25810
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/opengl/combinedFragmentShader.glsl b/vcl/opengl/combinedFragmentShader.glsl
index c44e75c..8d73d08 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;
More information about the Libreoffice-commits
mailing list