summaryrefslogtreecommitdiff
path: root/canvas/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-09-24 13:34:51 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-09-29 09:55:14 +0200
commit748723883a626b499f605d7a5bad92e25b69a0e4 (patch)
tree9c904ad85cd707fb69e14e74770d7d07402c12c0 /canvas/source
parent4deadc3c78949c18bb886eb1f66caa8f3cd7a2df (diff)
Revert "don't split polypolygon in canvas if not needed" (tdf#136933)
With the doc from tdf#136933 basegfx::utils::createNonzeroConform() gets called with huge polygons, which is very expensive. Revert this, I'll fix the Skia problem by directly trying to draw the stroked polygon with VCL. This reverts commit b0788ff11481568b413ff6e4c3ea4871984af974. Change-Id: I19b3435811b6ea38d83bea08056802aac76bf45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103312 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'canvas/source')
-rw-r--r--canvas/source/vcl/canvashelper.cxx44
1 files changed, 17 insertions, 27 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 2e8476649e3d..a9c9e1eda6d3 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -25,7 +25,6 @@
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/utils/canvastools.hxx>
@@ -395,33 +394,24 @@ namespace vclcanvas
// user coordinates.
aStrokedPolyPoly.transform( aMatrix );
- if(aStrokedPolyPoly.isClosed())
- {
- // Note: the generated stroke poly-polygon is NOT free of
- // self-intersections. Therefore, if we would render it
- // directly via OutDev::DrawPolyPolygon(), on/off fill would
- // generate off areas on those self-intersections.
- aStrokedPolyPoly = basegfx::utils::createNonzeroConform( aStrokedPolyPoly );
- mpOutDevProvider->getOutDev().DrawPolyPolygon( aStrokedPolyPoly );
- if( mp2ndOutDevProvider )
- mp2ndOutDevProvider->getOutDev().DrawPolyPolygon( aStrokedPolyPoly );
- }
- else
+ // TODO(F2): When using alpha here, must handle that via
+ // temporary surface or somesuch.
+
+ // Note: the generated stroke poly-polygon is NOT free of
+ // self-intersections. Therefore, if we would render it
+ // via OutDev::DrawPolyPolygon(), on/off fill would
+ // generate off areas on those self-intersections.
+ for( sal_uInt32 i=0; i<aStrokedPolyPoly.count(); ++i )
{
- // TODO(F2): When using alpha here, must handle that via
- // temporary surface or somesuch.
- for( sal_uInt32 i=0; i<aStrokedPolyPoly.count(); ++i )
- {
- const basegfx::B2DPolygon& polygon = aStrokedPolyPoly.getB2DPolygon( i );
- if( polygon.isClosed()) {
- mpOutDevProvider->getOutDev().DrawPolygon( polygon );
- if( mp2ndOutDevProvider )
- mp2ndOutDevProvider->getOutDev().DrawPolygon( polygon );
- } else {
- mpOutDevProvider->getOutDev().DrawPolyLine( polygon );
- if( mp2ndOutDevProvider )
- mp2ndOutDevProvider->getOutDev().DrawPolyLine( polygon );
- }
+ const basegfx::B2DPolygon& polygon = aStrokedPolyPoly.getB2DPolygon( i );
+ if( polygon.isClosed()) {
+ mpOutDevProvider->getOutDev().DrawPolygon( polygon );
+ if( mp2ndOutDevProvider )
+ mp2ndOutDevProvider->getOutDev().DrawPolygon( polygon );
+ } else {
+ mpOutDevProvider->getOutDev().DrawPolyLine( polygon );
+ if( mp2ndOutDevProvider )
+ mp2ndOutDevProvider->getOutDev().DrawPolyLine( polygon );
}
}
}