[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/headless

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 28 20:58:51 UTC 2019


 vcl/headless/svpgdi.cxx |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit 7ab849142d163f9405ec12a1af55e32eaf662de0
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Oct 28 16:37:57 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Oct 28 20:41:38 2019 +0000

    headless: optimize DrawWaveLine / drawPixel.
    
    ImplDrawWaveLine - used to render colored lines under mis-spelled
    and/or grammatically interesting sections uses (for better or worse)
    'drawPixel' to draw the line.
    
    Implementing drawPixel with a tiny B2DPolyPolygon is easy reading
    but triggers the unbelievably expensive SystemDependentDataHolder
    paths as well as some big chunks of logic for very large numbers
    of pixels (if you have lots of mis-spelling this can make typing
    visibly slower.).
    
    Change-Id: Ie6ad513e27f820bcad5030579428374c8d22fb3d

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index b0f6f530e8bd..9c8a4bb97900 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -709,22 +709,14 @@ void SvpSalGraphics::drawPixel( long nX, long nY )
     }
 }
 
-void SvpSalGraphics::drawPixel( long nX, long nY, Color nColor )
+void SvpSalGraphics::drawPixel( long nX, long nY, Color aColor )
 {
-    Color aOrigFillColor = m_aFillColor;
-    Color aOrigLineColor = m_aLineColor;
-
-    basegfx::B2DPolygon aRect = basegfx::utils::createPolygonFromRect(basegfx::B2DRectangle(nX, nY, nX+1, nY+1));
-    m_aLineColor = SALCOLOR_NONE;
-    m_aFillColor = nColor;
-
-    drawPolyPolygon(
-        basegfx::B2DHomMatrix(),
-        basegfx::B2DPolyPolygon(aRect),
-        0.0);
+    cairo_t* cr = getCairoContext(true);
+    clipRegion(cr);
 
-    m_aFillColor = aOrigFillColor;
-    m_aLineColor = aOrigLineColor;
+    cairo_rectangle(cr, nX, nY, 1, 1);
+    applyColor(cr, aColor, 0.0);
+    cairo_fill(cr);
 }
 
 void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )


More information about the Libreoffice-commits mailing list