summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-11-19 13:55:54 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-11-19 15:45:34 +0100
commite289fdedeb326a37253be509962c6c8ba0ccee80 (patch)
tree88a1953f8e316fef40226e67c7c681fcd65b3b39 /cppcanvas
parentb0eceb839a8ddb70412d8cc5737eb3bd2b90b2c8 (diff)
canvas: simplify getViewStateTransform/getRenderStateTransform
Change-Id: If9487aff0d80f7ee9d368cd97bc2828a856cc392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176766 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx4
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx10
-rw-r--r--cppcanvas/source/mtfrenderer/transparencygroupaction.cxx6
-rw-r--r--cppcanvas/source/wrapper/implcanvas.cxx4
4 files changed, 7 insertions, 17 deletions
diff --git a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx
index 99f4f95ecc9a..94cc42f77e4a 100644
--- a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx
+++ b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx
@@ -47,9 +47,7 @@ namespace cppcanvas::internal
SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase: 0x" << std::hex << this );
const rendering::ViewState aViewState( mpCanvas->getViewState() );
- ::basegfx::B2DHomMatrix aTotalTransform;
-
- ::canvas::tools::getViewStateTransform( aTotalTransform,
+ ::basegfx::B2DHomMatrix aTotalTransform = ::canvas::tools::getViewStateTransform(
aViewState );
aTotalTransform *= rTransformation;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 4a041ee5de5a..381387080bd3 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2980,9 +2980,7 @@ namespace cppcanvas::internal
// render subset of actions
// ========================
- ::basegfx::B2DHomMatrix aMatrix;
- ::canvas::tools::getRenderStateTransform( aMatrix,
- getRenderState() );
+ ::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform( getRenderState() );
ActionRenderer aRenderer( aMatrix );
@@ -3024,8 +3022,7 @@ namespace cppcanvas::internal
// query bounds for subset of actions
// ==================================
- ::basegfx::B2DHomMatrix aMatrix;
- ::canvas::tools::getRenderStateTransform( aMatrix,
+ ::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform(
getRenderState() );
AreaQuery aQuery( aMatrix );
@@ -3043,8 +3040,7 @@ namespace cppcanvas::internal
{
SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::ImplRenderer::draw()" );
- ::basegfx::B2DHomMatrix aMatrix;
- ::canvas::tools::getRenderStateTransform( aMatrix,
+ ::basegfx::B2DHomMatrix aMatrix = ::canvas::tools::getRenderStateTransform(
getRenderState() );
try
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index c3c1cfdf50f6..1f62c0bc30d9 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -176,12 +176,10 @@ namespace cppcanvas::internal
// determine overall transformation matrix (render, view,
// and passed transformation)
- ::basegfx::B2DHomMatrix aTransform;
- ::canvas::tools::getRenderStateTransform( aTransform, maState );
+ ::basegfx::B2DHomMatrix aTransform = ::canvas::tools::getRenderStateTransform( maState );
aTransform = rTransformation * aTransform;
- ::basegfx::B2DHomMatrix aTotalTransform;
- ::canvas::tools::getViewStateTransform( aTotalTransform, mpCanvas->getViewState() );
+ ::basegfx::B2DHomMatrix aTotalTransform = ::canvas::tools::getViewStateTransform( mpCanvas->getViewState() );
aTotalTransform = aTotalTransform * aTransform;
// since pure translational changes to the transformation
diff --git a/cppcanvas/source/wrapper/implcanvas.cxx b/cppcanvas/source/wrapper/implcanvas.cxx
index 81b5a3759fd6..6f13f7452e65 100644
--- a/cppcanvas/source/wrapper/implcanvas.cxx
+++ b/cppcanvas/source/wrapper/implcanvas.cxx
@@ -55,9 +55,7 @@ namespace cppcanvas::internal
::basegfx::B2DHomMatrix ImplCanvas::getTransformation() const
{
- ::basegfx::B2DHomMatrix aMatrix;
- return ::canvas::tools::getViewStateTransform( aMatrix,
- maViewState );
+ return ::canvas::tools::getViewStateTransform( maViewState );
}
void ImplCanvas::setClip( const ::basegfx::B2DPolyPolygon& rClipPoly )