From e289fdedeb326a37253be509962c6c8ba0ccee80 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 19 Nov 2024 13:55:54 +0100 Subject: canvas: simplify getViewStateTransform/getRenderStateTransform Change-Id: If9487aff0d80f7ee9d368cd97bc2828a856cc392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176766 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx | 4 +--- cppcanvas/source/mtfrenderer/implrenderer.cxx | 10 +++------- cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 6 ++---- cppcanvas/source/wrapper/implcanvas.cxx | 4 +--- 4 files changed, 7 insertions(+), 17 deletions(-) (limited to 'cppcanvas') 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 ) -- cgit v1.2.3