office-gobmx/vcl/opengl
Miklos Vajna 777a26b180 tdf#107966 vcl opengl: fix not drawn 1px wide polypolygons
Visible at e.g. in Calc: Format Cells/Borders/Line Styles.

The problem was that first commit
2e99e4e11d (opengl: use MVP matrix in
vertex shaders, pixel offsets, 2015-07-08) introduced the concept of
pixel offsets, setting the value (implicitly) to 0 in
OpenGLSalGraphicsImpl::DrawTrapezoid(), but using 0.5 in
OpenGLSalGraphicsImpl::FlushLinesOrTriangles().

This is fine, but then later commit
2003076c43 (opengl: batch draw
polypolygons, 2016-05-29) changed
OpenGLSalGraphicsImpl::drawPolyPolygon() to use deferred drawing instead
of DrawTrapezoid(), without doing any translation of the input
polypolygon. This resulted in loss of those polygons when used in the
above mentioned dialog, which has a listbox of bitmaps, where each line
style preview is drawn on a virtual device with a height of 1px. So at
the end the 1px offset meant the previews were simply missing.

('make CppunitTest_vcl_gen SAL_USE_VCLPLUGIN=gen SAL_FORCEGL=1' is
needed on Linux to see the test failing without the fix.)

(cherry picked from commit 75e152a7e8)

Change-Id: Ia9f3d6e7cb38a43fe2f8a41746b538af68add43c
Reviewed-on: https://gerrit.libreoffice.org/69931
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-30 04:06:58 +01:00
..
shaders
win
x11
DeviceInfo.cxx
FixedTextureAtlas.cxx
framebuffer.cxx
gdiimpl.cxx
LineRenderUtils.cxx
opengl_blacklist_windows.xml
PackedTextureAtlas.cxx
program.cxx
README.deprecated
README.opengl
RenderList.cxx
salbmp.cxx
scale.cxx
texture.cxx

Run LO with OpenGL enabled
--------------------------
SAL_USE_VCLPLUGIN=gtk SAL_FORCEGL=1 ./soffice

Environment variables used:

SAL_USE_VCLPLUGIN - use the specified VCL plugin (GTK2 in this case - currently
needed on Linux because the default GTK3 doesn't support OpenGL yet)

SAL_FORCEGL - enable OpenGL even if the card is blacklisted.

Other variables:

LIBGL_ALWAYS_SOFTWARE=1 - on Linux+Mesa forces the software renderer to be used
(this is useful as an alternative to spot driver specific bugs)

SAL_LOG=+INFO.vcl.opengl - if "--enable-dbgutil" is used, this can show OpenGL
various rendering messages.

LD_PRELOAD=/usr/lib64/apitrace/wrappers/glxtrace.so - preload the wrapper for
APItrace. The path is the default used in Fedora 21+.

Run VCLDemo
-----------

SAL_USE_VCLPLUGIN=gtk SAL_FORCEGL=1 ./bin/run vcldemo