Support buffering SystemDependent GraphicData (III)

Desktop / LibreOffice - Armin Le Grand [] - 20 September 2018 18:01 EDT

This change is for speedup of fat line drawing when using X11. This is a long-term problem which never really progressed, but is avoided using Cairo in the future. Still - if used, speedup using current state and buffering possibilities.

Two speedup steps will be used: (1) The tesselation is no longer done using trapezoids. That works (but was done wrong leaving artifacts) but is not fast and done every time. It is even not done with FatLines and more than 1000 points. New version will use triangulation. Dspite using the existing triangulator (that works but is slow) extend the FatLine geometry creator to directly create triangles. This is also necessary since for buffering that data a transformation-invariant version is needed (in device coordinates the data changes all the time when scrolling). Trapezoids are by definition *not* transformation-invariant (e.g. rotation)

(2) Buffer that triangulation - with the needed care and watch. It is e.g. necessary to react on 'hairlines' since these change their logical LineWidth view-dependent (zoom). In those cases, the buffered data *has* to be removed due to the base for buffering is the created FatLine geometry based on one stable logical LineWidth

Also took the time to adapt B2DPolygonTriangulator to use an own data type (B2DTriangle) and a vector of these for better understandability and security. Adapted all usages as needed.

Change-Id: Iedb2932b094a8786fd9c32d0d0ab1ca603a1a7b2 Reviewed-on:

66232248ff55 Support buffering SystemDependent GraphicData (III)
basegfx/source/polygon/b2dlinegeometry.cxx | 128 ++++++++--
basegfx/source/polygon/b2dpolygontools.cxx | 11 +-
basegfx/source/polygon/b2dpolygontriangulator.cxx | 27 +-
canvas/source/opengl/ogl_canvascustomsprite.cxx | 31 ++-
canvas/source/opengl/ogl_canvastools.cxx | 29 ++-
canvas/source/tools/surfaceproxy.cxx | 19 +-
include/basegfx/polygon/b2dlinegeometry.hxx | 9 +-
include/basegfx/polygon/b2dpolygontools.hxx | 5 +-
include/basegfx/polygon/b2dpolygontriangulator.hxx | 35 ++-
vcl/unx/generic/gdi/gdiimpl.cxx | 274 +++++++++++++++------
vcl/unx/generic/gdi/gdiimpl.hxx | 6 +
vcl/unx/generic/gdi/salgdi.cxx | 10 +-
vcl/unx/generic/gdi/xrender_peer.hxx | 11 +
13 files changed, 461 insertions(+), 134 deletions(-)


  • Share