vcl/headless/CairoCommon.cxx                |    6 +++---
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |    4 ++--
 vcl/source/outdev/text.cxx                  |    8 ++------
 3 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit ea1404e42063be2c9737755ffb7528329515f429
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Mar 23 14:43:06 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Sun Mar 23 21:41:43 2025 +0100

    use more B2DRange::translate
    
    which is much more efficient that using a matrix operation
    
    Change-Id: I8d5f3dae7ac5be0181d84081d94803ced9b86758
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183245
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index be25063a94e3..033fc8407d0c 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -777,7 +777,7 @@ void CairoCommon::drawLine(tools::Long nX1, tools::Long 
nY1, tools::Long nX2, to
     CairoCommon::applyColor(cr, *m_oLineColor);
 
     basegfx::B2DRange extents = getClippedStrokeDamage(cr);
-    extents.transform(basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5));
+    extents.translate(0.5, 0.5);
 
     cairo_stroke(cr);
 
@@ -965,7 +965,7 @@ void CairoCommon::drawPolyPolygon(const 
basegfx::B2DHomMatrix& rObjectToDevice,
 
         // expand with possible StrokeDamage
         basegfx::B2DRange stroke_extents = getClippedStrokeDamage(cr);
-        
stroke_extents.transform(basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5));
+        stroke_extents.translate(0.5, 0.5);
         extents.expand(stroke_extents);
 
         cairo_stroke(cr);
@@ -1295,7 +1295,7 @@ bool CairoCommon::drawAlphaRect(tools::Long nX, 
tools::Long nY, tools::Long nWid
 
         // expand with possible StrokeDamage
         basegfx::B2DRange stroke_extents = getClippedStrokeDamage(cr);
-        
stroke_extents.transform(basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5));
+        stroke_extents.translate(0.5, 0.5);
         extents.expand(stroke_extents);
 
         cairo_stroke(cr);
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index fe226bd63598..44e51c42c75b 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -273,8 +273,8 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, 
SalGraphics& rGraphics
                     aInputRectangle.getMinX(), aInputRectangle.getMinY(),
                     aInputRectangle.getMaxX() + fDeltaX, 
aInputRectangle.getMaxY() + fDeltaY);
 
-                
aFinalRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(
-                    aTargetSurface.getMinX() - 0.5, aTargetSurface.getMinY() - 
0.5));
+                aFinalRectangle.translate(aTargetSurface.getMinX() - 0.5,
+                                          aTargetSurface.getMinY() - 0.5);
 
                 basegfx::B2DPolygon aB2DPolygon = 
basegfx::utils::createPolygonFromRect(
                     aFinalRectangle, rRectangle.mnRx / 
aFinalRectangle.getWidth() * 2.0,
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index ff83e0807a59..a54854403e8c 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2102,15 +2102,11 @@ bool 
OutputDevice::GetTextBoundRect(basegfx::B2DRectangle& rRect, const OUString
         if( bRet )
         {
             basegfx::B2DPoint aPos = 
pSalLayout->GetDrawPosition(basegfx::B2DPoint(nXOffset, 0));
-            auto m = basegfx::utils::createTranslateB2DHomMatrix(mnTextOffX - 
aPos.getX(),
-                                                                 mnTextOffY - 
aPos.getY());
-            aPixelRect.transform(m);
+            aPixelRect.translate(mnTextOffX - aPos.getX(), mnTextOffY - 
aPos.getY());
             rRect = PixelToLogic( aPixelRect );
             if (mbMap)
             {
-                m = 
basegfx::utils::createTranslateB2DHomMatrix(maMapRes.mnMapOfsX,
-                                                                
maMapRes.mnMapOfsY);
-                rRect.transform(m);
+                rRect.translate(maMapRes.mnMapOfsX, maMapRes.mnMapOfsY);
             }
         }
     }

Reply via email to