diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2015-01-18 22:49:22 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-01-19 15:04:23 +0000 |
commit | 75750941b77620c215d50981f2cd8582f61d3eff (patch) | |
tree | 2aec160312bdbad1a036bd6802e1634d28645eb1 /vcl | |
parent | 1c5e4dcb8da19dc8674fd96ad3bb83793153e879 (diff) |
try to handle properly fillcolor != linecolor in opengl polypolygons drawing
Change-Id: I962416f48fdb348d8a3d95edf747cfe2f1c929c9
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 60f5a455c5f7..95840567c699 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1189,7 +1189,7 @@ void OpenGLSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* } } - if( UseSolidAA( mnLineColor ) ) + if( mnLineColor != mnFillColor && UseSolidAA( mnLineColor ) ) { // TODO Use glMultiDrawElements or primitive restart for( sal_uInt32 i = 0; i < nPoly; i++ ) @@ -1210,6 +1210,20 @@ bool OpenGLSalGraphicsImpl::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rP if( UseSolid( mnFillColor, fTransparency ) ) DrawPolyPolygon( rPolyPolygon ); + if( mnLineColor != mnFillColor && UseSolidAA( mnLineColor ) ) + { + for( sal_uInt32 i = 0; i < rPolyPolygon.count(); i++ ) + { + const basegfx::B2DPolygon& polygon = rPolyPolygon.getB2DPolygon( i ); + for( sal_uInt32 j = 0; j < polygon.count(); ++j ) + { + const basegfx::B2DPoint& rPt1 = polygon.getB2DPoint( j ); + const basegfx::B2DPoint& rPt2 = polygon.getB2DPoint(( j + 1 ) % polygon.count()); + DrawLineAA( rPt1.getX(), rPt1.getY(), rPt2.getX(), rPt2.getY()); + } + } + } + PostDraw(); return true; |