diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-13 10:54:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-18 11:34:09 +0000 |
commit | 7d8e94aaaddff0708dd8a5a6fde4d9922cd4e1ea (patch) | |
tree | a49bb018197b781d249a40fda1396cb15bc81fbe /vcl/headless | |
parent | fece8dfb0669280f6d7ff754b63e56eaa452ce24 (diff) |
tweak drawLine in face of 1bit behavior
Change-Id: I602b800993b7478b302fe0c368a5db9fc9993465
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index cf861ffe8387..30b319440069 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -747,16 +747,6 @@ void SvpSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor ) m_aFillColor = aOrigFillColor; } -void SvpSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 ) -{ - basegfx::B2DPolygon aPoly; - aPoly.append(basegfx::B2DPoint(nX1, nY1), 2); - aPoly.setB2DPoint(1, basegfx::B2DPoint(nX2, nY2)); - aPoly.setClosed(false); - drawPolyLine(aPoly, 0.0, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLineJoin::Middle, - css::drawing::LineCap_BUTT); -} - void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) { // because of the -1 hack we have to do fill and draw separately @@ -912,6 +902,28 @@ static void AddPolygonToPath(cairo_t* cr, const basegfx::B2DPolygon& rPolygon, b } } +void SvpSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 ) +{ + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(nX1, nY1), 2); + aPoly.setB2DPoint(1, basegfx::B2DPoint(nX2, nY2)); + aPoly.setClosed(false); + + cairo_t* cr = getCairoContext(false); + assert(cr && m_aDevice->isTopDown()); + clipRegion(cr); + + AddPolygonToPath(cr, aPoly, aPoly.isClosed(), !getAntiAliasB2DDraw(), true); + + applyColor(cr, m_aLineColor); + + cairo_rectangle_int_t extents = getStrokeDamage(cr); + + cairo_stroke(cr); + + releaseCairoContext(cr, false, extents); +} + bool SvpSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolyLine, double fTransparency, |