clang-tidy modernize-pass-by-value in canvas

Change-Id: Ib6e1b6182d83b09dbf5e2aeb9cf3e4ca11d9f48b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134712
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-05-21 17:59:07 +02:00
parent 098df8583b
commit 08f757c32f
33 changed files with 139 additions and 118 deletions

View File

@ -53,8 +53,8 @@ namespace canvas
@param rTarget @param rTarget
The target canvas the repaint should happen on. The target canvas the repaint should happen on.
*/ */
CachedPrimitiveBase( const css::rendering::ViewState& rUsedViewState, CachedPrimitiveBase( css::rendering::ViewState rUsedViewState,
const css::uno::Reference< css::rendering::XCanvas >& rTarget ); css::uno::Reference< css::rendering::XCanvas > xTarget );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;

View File

@ -26,6 +26,7 @@
#include <canvas/canvastoolsdllapi.h> #include <canvas/canvastoolsdllapi.h>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <utility>
namespace com::sun::star::rendering { class XGraphicDevice; } namespace com::sun::star::rendering { class XGraphicDevice; }
@ -54,12 +55,12 @@ namespace canvas
*/ */
struct Values struct Values
{ {
Values( const ::basegfx::B2DPolygon& rGradientPoly, Values( ::basegfx::B2DPolygon aGradientPoly,
const css::uno::Sequence< css::uno::Sequence< double > >& rColors, const css::uno::Sequence< css::uno::Sequence< double > >& rColors,
const css::uno::Sequence< double >& rStops, const css::uno::Sequence< double >& rStops,
double nAspectRatio, double nAspectRatio,
GradientType eType ) : GradientType eType ) :
maGradientPoly( rGradientPoly ), maGradientPoly(std::move( aGradientPoly )),
mnAspectRatio( nAspectRatio ), mnAspectRatio( nAspectRatio ),
maColors( rColors ), maColors( rColors ),
maStops( rStops ), maStops( rStops ),
@ -127,15 +128,15 @@ namespace canvas
double fAspect ); double fAspect );
/// Private, because objects can only be created from the static factories /// Private, because objects can only be created from the static factories
ParametricPolyPolygon( const css::uno::Reference< ParametricPolyPolygon( css::uno::Reference<
css::rendering::XGraphicDevice >& rDevice, css::rendering::XGraphicDevice > xDevice,
const ::basegfx::B2DPolygon& rGradientPoly, const ::basegfx::B2DPolygon& rGradientPoly,
GradientType eType, GradientType eType,
const css::uno::Sequence< css::uno::Sequence< double > >& colors, const css::uno::Sequence< css::uno::Sequence< double > >& colors,
const css::uno::Sequence< double >& stops, const css::uno::Sequence< double >& stops,
double nAspectRatio ); double nAspectRatio );
ParametricPolyPolygon( const css::uno::Reference< ParametricPolyPolygon( css::uno::Reference<
css::rendering::XGraphicDevice >& rDevice, css::rendering::XGraphicDevice > xDevice,
GradientType eType, GradientType eType,
const css::uno::Sequence< css::uno::Sequence< double > >& colors, const css::uno::Sequence< css::uno::Sequence< double > >& colors,
const css::uno::Sequence< double >& stops ); const css::uno::Sequence< double >& stops );

View File

@ -20,6 +20,7 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <utility>
namespace basegfx namespace basegfx
{ {
@ -112,8 +113,8 @@ namespace canvas
class RenderModuleGuard class RenderModuleGuard
{ {
public: public:
explicit RenderModuleGuard( const std::shared_ptr<IRenderModule>& rRenderModule ) : explicit RenderModuleGuard( std::shared_ptr<IRenderModule> xRenderModule ) :
mpRenderModule( rRenderModule ) mpRenderModule(std::move( xRenderModule ))
{ {
mpRenderModule->lock(); mpRenderModule->lock();
} }

View File

@ -25,6 +25,7 @@
#include <basegfx/range/b2drange.hxx> #include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx> #include <basegfx/range/b2drectangle.hxx>
#include <utility>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
@ -76,10 +77,10 @@ namespace canvas
@internal @internal
*/ */
SpriteInfo( const Sprite::Reference& rRef, SpriteInfo( Sprite::Reference aRef,
const ::basegfx::B2DRange& rTrueUpdateArea, const ::basegfx::B2DRange& rTrueUpdateArea,
bool bNeedsUpdate ) : bool bNeedsUpdate ) :
mpSprite( rRef ), mpSprite(std::move( aRef )),
maTrueUpdateArea( rTrueUpdateArea ), maTrueUpdateArea( rTrueUpdateArea ),
mbNeedsUpdate( bNeedsUpdate ), mbNeedsUpdate( bNeedsUpdate ),
mbIsPureMove( false ) mbIsPureMove( false )
@ -105,11 +106,11 @@ namespace canvas
@internal @internal
*/ */
SpriteInfo( const Sprite::Reference& rRef, SpriteInfo( Sprite::Reference aRef,
const ::basegfx::B2DRange& rTrueUpdateArea, const ::basegfx::B2DRange& rTrueUpdateArea,
bool bNeedsUpdate, bool bNeedsUpdate,
bool bIsPureMove ) : bool bIsPureMove ) :
mpSprite( rRef ), mpSprite(std::move( aRef )),
maTrueUpdateArea( rTrueUpdateArea ), maTrueUpdateArea( rTrueUpdateArea ),
mbNeedsUpdate( bNeedsUpdate ), mbNeedsUpdate( bNeedsUpdate ),
mbIsPureMove( bIsPureMove ) mbIsPureMove( bIsPureMove )
@ -140,12 +141,12 @@ namespace canvas
{ {
enum class ChangeType { move, update }; enum class ChangeType { move, update };
SpriteChangeRecord( const Sprite::Reference& rSprite, SpriteChangeRecord( Sprite::Reference rSprite,
const ::basegfx::B2DPoint& rOldPos, const ::basegfx::B2DPoint& rOldPos,
const ::basegfx::B2DPoint& rNewPos, const ::basegfx::B2DPoint& rNewPos,
const ::basegfx::B2DVector& rSpriteSize ) : const ::basegfx::B2DVector& rSpriteSize ) :
meChangeType( ChangeType::move ), meChangeType( ChangeType::move ),
mpAffectedSprite( rSprite ), mpAffectedSprite(std::move( rSprite )),
maOldPos( rOldPos ), maOldPos( rOldPos ),
maUpdateArea( rNewPos.getX(), maUpdateArea( rNewPos.getX(),
rNewPos.getY(), rNewPos.getY(),
@ -154,11 +155,11 @@ namespace canvas
{ {
} }
SpriteChangeRecord( const Sprite::Reference& rSprite, SpriteChangeRecord( Sprite::Reference rSprite,
const ::basegfx::B2DPoint& rPos, const ::basegfx::B2DPoint& rPos,
const ::basegfx::B2DRange& rUpdateArea ) : const ::basegfx::B2DRange& rUpdateArea ) :
meChangeType( ChangeType::update ), meChangeType( ChangeType::update ),
mpAffectedSprite( rSprite ), mpAffectedSprite(std::move( rSprite )),
maOldPos( rPos ), maOldPos( rPos ),
maUpdateArea( rUpdateArea ) maUpdateArea( rUpdateArea )
{ {

View File

@ -21,6 +21,7 @@
#include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/RepaintResult.hpp> #include <com/sun/star/rendering/RepaintResult.hpp>
#include <utility>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include "cairo_cachedbitmap.hxx" #include "cairo_cachedbitmap.hxx"
@ -32,13 +33,13 @@ using namespace ::com::sun::star;
namespace cairocanvas namespace cairocanvas
{ {
CachedBitmap::CachedBitmap( const SurfaceSharedPtr& pSurface, CachedBitmap::CachedBitmap( SurfaceSharedPtr pSurface,
const rendering::ViewState& rUsedViewState, const rendering::ViewState& rUsedViewState,
const rendering::RenderState& rUsedRenderState, rendering::RenderState aUsedRenderState,
const uno::Reference< rendering::XCanvas >& rTarget ) : const uno::Reference< rendering::XCanvas >& rTarget ) :
CachedPrimitiveBase( rUsedViewState, rTarget ), CachedPrimitiveBase( rUsedViewState, rTarget ),
mpSurface( pSurface ), mpSurface(std::move( pSurface )),
maRenderState( rUsedRenderState ) maRenderState(std::move( aUsedRenderState ))
{} {}
void SAL_CALL CachedBitmap::disposing() void SAL_CALL CachedBitmap::disposing()

View File

@ -34,10 +34,10 @@ namespace cairocanvas
/** Create an XCachedPrimitive for given GraphicObject /** Create an XCachedPrimitive for given GraphicObject
*/ */
CachedBitmap( const ::cairo::SurfaceSharedPtr& pSurface, CachedBitmap( ::cairo::SurfaceSharedPtr pSurface,
const css::rendering::ViewState& rUsedViewState, const css::rendering::ViewState& rUsedViewState,
const css::rendering::RenderState& rUsedRenderState, css::rendering::RenderState aUsedRenderState,
const css::uno::Reference< css::rendering::XCanvas >& rTarget ); const css::uno::Reference< css::rendering::XCanvas >& rTarget );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;

View File

@ -22,6 +22,7 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <utility>
#include <vcl/bitmapex.hxx> #include <vcl/bitmapex.hxx>
#include <vcl/BitmapTools.hxx> #include <vcl/BitmapTools.hxx>
@ -35,10 +36,10 @@ using namespace ::com::sun::star;
namespace cairocanvas namespace cairocanvas
{ {
CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize, CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize,
const SurfaceProviderRef& rSurfaceProvider, SurfaceProviderRef rSurfaceProvider,
rendering::XGraphicDevice* pDevice, rendering::XGraphicDevice* pDevice,
bool bHasAlpha ) : bool bHasAlpha ) :
mpSurfaceProvider( rSurfaceProvider ), mpSurfaceProvider(std::move( rSurfaceProvider )),
maSize(rSize), maSize(rSize),
mbHasAlpha(bHasAlpha) mbHasAlpha(bHasAlpha)
{ {

View File

@ -69,7 +69,7 @@ namespace cairocanvas
Reference device, with which bitmap should be compatible Reference device, with which bitmap should be compatible
*/ */
CanvasBitmap( const ::basegfx::B2ISize& rSize, CanvasBitmap( const ::basegfx::B2ISize& rSize,
const SurfaceProviderRef& rDevice, SurfaceProviderRef rDevice,
css::rendering::XGraphicDevice* pDevice, css::rendering::XGraphicDevice* pDevice,
bool bHasAlpha ); bool bHasAlpha );

View File

@ -24,6 +24,7 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <rtl/math.hxx> #include <rtl/math.hxx>
#include <utility>
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include "cairo_canvasfont.hxx" #include "cairo_canvasfont.hxx"
@ -37,13 +38,13 @@ namespace cairocanvas
CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/, const uno::Sequence< beans::PropertyValue >& /*rExtraFontProperties*/,
const geometry::Matrix2D& rFontMatrix, const geometry::Matrix2D& rFontMatrix,
const SurfaceProviderRef& rDevice ) : SurfaceProviderRef rDevice ) :
CanvasFont_Base( m_aMutex ), CanvasFont_Base( m_aMutex ),
maFont( vcl::Font( rFontRequest.FontDescription.FamilyName, maFont( vcl::Font( rFontRequest.FontDescription.FamilyName,
rFontRequest.FontDescription.StyleName, rFontRequest.FontDescription.StyleName,
Size( 0, ::basegfx::fround(rFontRequest.CellSize) ) ) ), Size( 0, ::basegfx::fround(rFontRequest.CellSize) ) ) ),
maFontRequest( rFontRequest ), maFontRequest( rFontRequest ),
mpRefDevice( rDevice ) mpRefDevice(std::move( rDevice ))
{ {
maFont->SetAlignment( ALIGN_BASELINE ); maFont->SetAlignment( ALIGN_BASELINE );
maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE ); maFont->SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==css::util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );

View File

@ -51,9 +51,9 @@ namespace cairocanvas
const CanvasFont& operator=(const CanvasFont&) = delete; const CanvasFont& operator=(const CanvasFont&) = delete;
CanvasFont( const css::rendering::FontRequest& fontRequest, CanvasFont( const css::rendering::FontRequest& fontRequest,
const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties, const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties,
const css::geometry::Matrix2D& rFontMatrix, const css::geometry::Matrix2D& rFontMatrix,
const SurfaceProviderRef& rDevice ); SurfaceProviderRef rDevice );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;

View File

@ -28,6 +28,7 @@
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <utility>
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
@ -69,15 +70,15 @@ namespace cairocanvas
} }
} }
TextLayout::TextLayout( const rendering::StringContext& aText, TextLayout::TextLayout( rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
sal_Int64 /*nRandomSeed*/, sal_Int64 /*nRandomSeed*/,
const CanvasFont::Reference& rFont, CanvasFont::Reference rFont,
const SurfaceProviderRef& rRefDevice ) : SurfaceProviderRef rRefDevice ) :
TextLayout_Base( m_aMutex ), TextLayout_Base( m_aMutex ),
maText( aText ), maText(std::move( aText )),
mpFont( rFont ), mpFont(std::move( rFont )),
mpRefDevice( rRefDevice ), mpRefDevice(std::move( rRefDevice )),
mnTextDirection( nDirection ) mnTextDirection( nDirection )
{ {
} }
@ -286,8 +287,8 @@ namespace cairocanvas
class OffsetTransformer class OffsetTransformer
{ {
public: public:
explicit OffsetTransformer( const ::basegfx::B2DHomMatrix& rMat ) : explicit OffsetTransformer( ::basegfx::B2DHomMatrix aMat ) :
maMatrix( rMat ) maMatrix(std::move( aMat ))
{ {
} }

View File

@ -47,11 +47,11 @@ namespace cairocanvas
TextLayout(const TextLayout&) = delete; TextLayout(const TextLayout&) = delete;
const TextLayout& operator=(const TextLayout&) = delete; const TextLayout& operator=(const TextLayout&) = delete;
TextLayout( const css::rendering::StringContext& aText, TextLayout( css::rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
sal_Int64 nRandomSeed, sal_Int64 nRandomSeed,
const CanvasFont::Reference& rFont, CanvasFont::Reference rFont,
const SurfaceProviderRef& rRefDevice ); SurfaceProviderRef rRefDevice );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;

View File

@ -11,6 +11,8 @@
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <utility>
#include "ogl_canvasbitmap.hxx" #include "ogl_canvasbitmap.hxx"
@ -19,9 +21,9 @@ using namespace ::com::sun::star;
namespace oglcanvas namespace oglcanvas
{ {
CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize, CanvasBitmap::CanvasBitmap( const geometry::IntegerSize2D& rSize,
const SpriteCanvasRef& rDevice, SpriteCanvasRef rDevice,
SpriteDeviceHelper& rDeviceHelper ) : SpriteDeviceHelper& rDeviceHelper ) :
mpDevice( rDevice ) mpDevice(std::move( rDevice ))
{ {
ENSURE_OR_THROW( mpDevice.is(), ENSURE_OR_THROW( mpDevice.is(),
"CanvasBitmap::CanvasBitmap(): Invalid surface or device" ); "CanvasBitmap::CanvasBitmap(): Invalid surface or device" );

View File

@ -46,9 +46,9 @@ namespace oglcanvas
@param rDevice @param rDevice
Reference device, with which bitmap should be compatible Reference device, with which bitmap should be compatible
*/ */
CanvasBitmap( const css::geometry::IntegerSize2D& rSize, CanvasBitmap( const css::geometry::IntegerSize2D& rSize,
const SpriteCanvasRef& rDevice, SpriteCanvasRef rDevice,
SpriteDeviceHelper& rDeviceHelper ); SpriteDeviceHelper& rDeviceHelper );
/** Create verbatim copy (including all recorded actions) /** Create verbatim copy (including all recorded actions)
*/ */

View File

@ -11,6 +11,7 @@
#include <com/sun/star/rendering/FontMetrics.hpp> #include <com/sun/star/rendering/FontMetrics.hpp>
#include <canvas/canvastools.hxx> #include <canvas/canvastools.hxx>
#include <utility>
#include "ogl_canvasfont.hxx" #include "ogl_canvasfont.hxx"
#include "ogl_textlayout.hxx" #include "ogl_textlayout.hxx"
@ -19,11 +20,11 @@ using namespace ::com::sun::star;
namespace oglcanvas namespace oglcanvas
{ {
CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest, CanvasFont::CanvasFont( rendering::FontRequest aFontRequest,
const uno::Sequence< beans::PropertyValue >& extraFontProperties, const uno::Sequence< beans::PropertyValue >& extraFontProperties,
const geometry::Matrix2D& fontMatrix ) : const geometry::Matrix2D& fontMatrix ) :
CanvasFontBaseT( m_aMutex ), CanvasFontBaseT( m_aMutex ),
maFontRequest( rFontRequest ), maFontRequest(std::move( aFontRequest )),
mnEmphasisMark(0), mnEmphasisMark(0),
maFontMatrix( fontMatrix ) maFontMatrix( fontMatrix )
{ {

View File

@ -36,9 +36,9 @@ namespace oglcanvas
CanvasFont(const CanvasFont&) = delete; CanvasFont(const CanvasFont&) = delete;
const CanvasFont& operator=(const CanvasFont&) = delete; const CanvasFont& operator=(const CanvasFont&) = delete;
CanvasFont( const css::rendering::FontRequest& fontRequest, CanvasFont( css::rendering::FontRequest fontRequest,
const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties, const css::uno::Sequence< css::beans::PropertyValue >& extraFontProperties,
const css::geometry::Matrix2D& fontMatrix ); const css::geometry::Matrix2D& fontMatrix );
// XCanvasFont // XCanvasFont
virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override; virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout( const css::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) override;

View File

@ -9,6 +9,7 @@
#include <sal/config.h> #include <sal/config.h>
#include <sal/log.hxx> #include <sal/log.hxx>
#include <utility>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
@ -18,13 +19,13 @@ using namespace ::com::sun::star;
namespace oglcanvas namespace oglcanvas
{ {
TextLayout::TextLayout( const rendering::StringContext& aText, TextLayout::TextLayout( rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
sal_Int64 /*nRandomSeed*/, sal_Int64 /*nRandomSeed*/,
const CanvasFont::ImplRef& rFont ) : CanvasFont::ImplRef rFont ) :
TextLayoutBaseT( m_aMutex ), TextLayoutBaseT( m_aMutex ),
maText( aText ), maText(std::move( aText )),
mpFont( rFont ), mpFont(std::move( rFont )),
mnTextDirection( nDirection ) mnTextDirection( nDirection )
{ {
} }

View File

@ -27,10 +27,10 @@ namespace oglcanvas
public TextLayoutBaseT public TextLayoutBaseT
{ {
public: public:
TextLayout( const css::rendering::StringContext& aText, TextLayout( css::rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
sal_Int64 nRandomSeed, sal_Int64 nRandomSeed,
const CanvasFont::ImplRef& rFont ); CanvasFont::ImplRef rFont );
/// make noncopyable /// make noncopyable
TextLayout(const TextLayout&) = delete; TextLayout(const TextLayout&) = delete;

View File

@ -25,17 +25,18 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <base/cachedprimitivebase.hxx> #include <base/cachedprimitivebase.hxx>
#include <utility>
using namespace ::com::sun::star; using namespace ::com::sun::star;
namespace canvas namespace canvas
{ {
CachedPrimitiveBase::CachedPrimitiveBase( const rendering::ViewState& rUsedViewState, CachedPrimitiveBase::CachedPrimitiveBase( rendering::ViewState aUsedViewState,
const uno::Reference< rendering::XCanvas >& rTarget ) : uno::Reference< rendering::XCanvas > xTarget ) :
CachedPrimitiveBase_Base( m_aMutex ), CachedPrimitiveBase_Base( m_aMutex ),
maUsedViewState( rUsedViewState ), maUsedViewState(std::move( aUsedViewState )),
mxTarget( rTarget ) mxTarget(std::move( xTarget ))
{ {
} }

View File

@ -22,6 +22,7 @@
#include <canvas/elapsedtime.hxx> #include <canvas/elapsedtime.hxx>
#include <tools/time.hxx> #include <tools/time.hxx>
#include <utility>
namespace canvas::tools { namespace canvas::tools {
@ -41,8 +42,8 @@ ElapsedTime::ElapsedTime()
} }
ElapsedTime::ElapsedTime( ElapsedTime::ElapsedTime(
std::shared_ptr<ElapsedTime> const & pTimeBase ) std::shared_ptr<ElapsedTime> pTimeBase )
: m_pTimeBase( pTimeBase ), : m_pTimeBase(std::move( pTimeBase )),
m_fLastQueriedTime( 0.0 ), m_fLastQueriedTime( 0.0 ),
m_fStartTime( getCurrentTime() ), m_fStartTime( getCurrentTime() ),
m_fFrozenTime( 0.0 ), m_fFrozenTime( 0.0 ),

View File

@ -21,6 +21,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <rendering/irendermodule.hxx> #include <rendering/irendermodule.hxx>
#include <utility>
#include "page.hxx" #include "page.hxx"
@ -30,8 +31,8 @@ namespace canvas
class PageManager class PageManager
{ {
public: public:
explicit PageManager(const std::shared_ptr<canvas::IRenderModule>& rRenderModule) explicit PageManager(std::shared_ptr<canvas::IRenderModule> xRenderModule)
: mpRenderModule(rRenderModule) : mpRenderModule(std::move(xRenderModule))
{ {
} }

View File

@ -27,6 +27,7 @@
#include <com/sun/star/rendering/XGraphicDevice.hpp> #include <com/sun/star/rendering/XGraphicDevice.hpp>
#include <parametricpolypolygon.hxx> #include <parametricpolypolygon.hxx>
#include <utility>
using namespace ::com::sun::star; using namespace ::com::sun::star;
@ -197,13 +198,13 @@ namespace canvas
{ {
} }
ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, ParametricPolyPolygon::ParametricPolyPolygon( uno::Reference< rendering::XGraphicDevice > xDevice,
const ::basegfx::B2DPolygon& rGradientPoly, const ::basegfx::B2DPolygon& rGradientPoly,
GradientType eType, GradientType eType,
const uno::Sequence< uno::Sequence< double > >& rColors, const uno::Sequence< uno::Sequence< double > >& rColors,
const uno::Sequence< double >& rStops, const uno::Sequence< double >& rStops,
double nAspectRatio ) : double nAspectRatio ) :
mxDevice( rDevice ), mxDevice(std::move( xDevice )),
maValues( rGradientPoly, maValues( rGradientPoly,
rColors, rColors,
rStops, rStops,
@ -212,11 +213,11 @@ namespace canvas
{ {
} }
ParametricPolyPolygon::ParametricPolyPolygon( const uno::Reference< rendering::XGraphicDevice >& rDevice, ParametricPolyPolygon::ParametricPolyPolygon( uno::Reference< rendering::XGraphicDevice > xDevice,
GradientType eType, GradientType eType,
const uno::Sequence< uno::Sequence< double > >& rColors, const uno::Sequence< uno::Sequence< double > >& rColors,
const uno::Sequence< double >& rStops ) : const uno::Sequence< double >& rStops ) :
mxDevice( rDevice ), mxDevice(std::move( xDevice )),
maValues( ::basegfx::B2DPolygon(), maValues( ::basegfx::B2DPolygon(),
rColors, rColors,
rStops, rStops,

View File

@ -28,6 +28,7 @@
#include <spriteredrawmanager.hxx> #include <spriteredrawmanager.hxx>
#include <boost/range/adaptor/reversed.hpp> #include <boost/range/adaptor/reversed.hpp>
#include <utility>
namespace canvas namespace canvas
{ {
@ -43,8 +44,8 @@ namespace canvas
class SpriteTracer class SpriteTracer
{ {
public: public:
explicit SpriteTracer( const Sprite::Reference& rAffectedSprite ) : explicit SpriteTracer( Sprite::Reference rAffectedSprite ) :
mpAffectedSprite(rAffectedSprite), mpAffectedSprite(std::move(rAffectedSprite)),
mbIsMove( false ), mbIsMove( false ),
mbIsGenericUpdate( false ) mbIsGenericUpdate( false )
{ {

View File

@ -22,17 +22,18 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx> #include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <comphelper/scopeguard.hxx> #include <comphelper/scopeguard.hxx>
#include <utility>
#include "surface.hxx" #include "surface.hxx"
namespace canvas namespace canvas
{ {
Surface::Surface( const PageManagerSharedPtr& rPageManager, Surface::Surface( PageManagerSharedPtr rPageManager,
const std::shared_ptr<IColorBuffer>& rColorBuffer, std::shared_ptr<IColorBuffer> xColorBuffer,
const ::basegfx::B2IPoint& rPos, const ::basegfx::B2IPoint& rPos,
const ::basegfx::B2ISize& rSize ) : const ::basegfx::B2ISize& rSize ) :
mpColorBuffer(rColorBuffer), mpColorBuffer(std::move(xColorBuffer)),
mpPageManager(rPageManager), mpPageManager(std::move(rPageManager)),
maSourceOffset(rPos), maSourceOffset(rPos),
maSize(rSize), maSize(rSize),
mbIsDirty(true) mbIsDirty(true)

View File

@ -41,8 +41,8 @@ namespace canvas
{ {
public: public:
Surface( const PageManagerSharedPtr& rPageManager, Surface( PageManagerSharedPtr xPageManager,
const std::shared_ptr<IColorBuffer>& rColorBuffer, std::shared_ptr<IColorBuffer> xColorBuffer,
const ::basegfx::B2IPoint& rPos, const ::basegfx::B2IPoint& rPos,
const ::basegfx::B2ISize& rSize ); const ::basegfx::B2ISize& rSize );
~Surface(); ~Surface();

View File

@ -23,15 +23,16 @@
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygontriangulator.hxx> #include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <utility>
#include "surfaceproxy.hxx" #include "surfaceproxy.hxx"
namespace canvas namespace canvas
{ {
SurfaceProxy::SurfaceProxy( const std::shared_ptr<canvas::IColorBuffer>& pBuffer, SurfaceProxy::SurfaceProxy( std::shared_ptr<canvas::IColorBuffer> xBuffer,
const PageManagerSharedPtr& pPageManager ) : PageManagerSharedPtr xPageManager ) :
mpPageManager( pPageManager ), mpPageManager(std::move( xPageManager )),
mpBuffer( pBuffer ) mpBuffer(std::move( xBuffer ))
{ {
const ::basegfx::B2ISize aImageSize(mpBuffer->getWidth(),mpBuffer->getHeight()); const ::basegfx::B2ISize aImageSize(mpBuffer->getWidth(),mpBuffer->getHeight());
const ::basegfx::B2ISize aPageSize(mpPageManager->getPageSize()); const ::basegfx::B2ISize aPageSize(mpPageManager->getPageSize());

View File

@ -38,8 +38,8 @@ namespace canvas
{ {
public: public:
SurfaceProxy( const std::shared_ptr<canvas::IColorBuffer>& pBuffer, SurfaceProxy( std::shared_ptr<canvas::IColorBuffer> xBuffer,
const PageManagerSharedPtr &pPageManager ); PageManagerSharedPtr xPageManager );
// ISurfaceProxy interface // ISurfaceProxy interface
virtual void setColorBufferDirty() override; virtual void setColorBufferDirty() override;

View File

@ -21,6 +21,7 @@
#include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/RepaintResult.hpp> #include <com/sun/star/rendering/RepaintResult.hpp>
#include <utility>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include "cachedbitmap.hxx" #include "cachedbitmap.hxx"
@ -31,16 +32,16 @@ using namespace ::com::sun::star;
namespace vclcanvas namespace vclcanvas
{ {
CachedBitmap::CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, CachedBitmap::CachedBitmap( GraphicObjectSharedPtr xGraphicObject,
const ::Point& rPoint, const ::Point& rPoint,
const ::Size& rSize, const ::Size& rSize,
const GraphicAttr& rAttr, const GraphicAttr& rAttr,
const rendering::ViewState& rUsedViewState, const rendering::ViewState& rUsedViewState,
const rendering::RenderState& rUsedRenderState, rendering::RenderState aUsedRenderState,
const uno::Reference< rendering::XCanvas >& rTarget ) : const uno::Reference< rendering::XCanvas >& rTarget ) :
CachedPrimitiveBase( rUsedViewState, rTarget ), CachedPrimitiveBase( rUsedViewState, rTarget ),
mpGraphicObject( rGraphicObject ), mpGraphicObject(std::move( xGraphicObject )),
maRenderState(rUsedRenderState), maRenderState(std::move(aUsedRenderState)),
maPoint( rPoint ), maPoint( rPoint ),
maSize( rSize ), maSize( rSize ),
maAttributes( rAttr ) maAttributes( rAttr )

View File

@ -37,12 +37,12 @@ namespace vclcanvas
/** Create an XCachedPrimitive for given GraphicObject /** Create an XCachedPrimitive for given GraphicObject
*/ */
CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject, CachedBitmap( GraphicObjectSharedPtr xGraphicObject,
const ::Point& rPoint, const ::Point& rPoint,
const ::Size& rSize, const ::Size& rSize,
const GraphicAttr& rAttr, const GraphicAttr& rAttr,
const css::rendering::ViewState& rUsedViewState, const css::rendering::ViewState& rUsedViewState,
const css::rendering::RenderState& rUsedRenderState, css::rendering::RenderState aUsedRenderState,
const css::uno::Reference< css::rendering::XCanvas >& rTarget ); const css::uno::Reference< css::rendering::XCanvas >& rTarget );
/// Dispose all internal references /// Dispose all internal references

View File

@ -30,6 +30,7 @@
#include <com/sun/star/rendering/ViewState.hpp> #include <com/sun/star/rendering/ViewState.hpp>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <utility>
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
@ -73,16 +74,16 @@ namespace vclcanvas
} }
} }
TextLayout::TextLayout( const rendering::StringContext& aText, TextLayout::TextLayout( rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
const CanvasFont::Reference& rFont, CanvasFont::Reference rFont,
const uno::Reference<rendering::XGraphicDevice>& xDevice, uno::Reference<rendering::XGraphicDevice> xDevice,
const OutDevProviderSharedPtr& rOutDev ) : OutDevProviderSharedPtr xOutDev ) :
TextLayout_Base( m_aMutex ), TextLayout_Base( m_aMutex ),
maText( aText ), maText(std::move( aText )),
mpFont( rFont ), mpFont(std::move( rFont )),
mxDevice( xDevice ), mxDevice(std::move( xDevice )),
mpOutDevProvider( rOutDev ), mpOutDevProvider(std::move( xOutDev )),
mnTextDirection( nDirection ) mnTextDirection( nDirection )
{} {}
@ -360,8 +361,8 @@ namespace vclcanvas
class OffsetTransformer class OffsetTransformer
{ {
public: public:
explicit OffsetTransformer( const ::basegfx::B2DHomMatrix& rMat ) : explicit OffsetTransformer( ::basegfx::B2DHomMatrix aMat ) :
maMatrix( rMat ) maMatrix(std::move( aMat ))
{ {
} }

View File

@ -45,12 +45,12 @@ namespace vclcanvas
TextLayout(const TextLayout&) = delete; TextLayout(const TextLayout&) = delete;
const TextLayout& operator=(const TextLayout&) = delete; const TextLayout& operator=(const TextLayout&) = delete;
TextLayout( const css::rendering::StringContext& aText, TextLayout( css::rendering::StringContext aText,
sal_Int8 nDirection, sal_Int8 nDirection,
const CanvasFont::Reference& rFont, CanvasFont::Reference rFont,
const css::uno::Reference< css::uno::Reference<
css::rendering::XGraphicDevice>& xDevice, css::rendering::XGraphicDevice> xDevice,
const OutDevProviderSharedPtr& rOutDev ); OutDevProviderSharedPtr xOutDev );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;

View File

@ -39,6 +39,7 @@
#include <comphelper/random.hxx> #include <comphelper/random.hxx>
#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx>
#include <o3tl/safeint.hxx> #include <o3tl/safeint.hxx>
#include <utility>
#include <vcl/canvastools.hxx> #include <vcl/canvastools.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/vclmain.hxx> #include <vcl/vclmain.hxx>
@ -92,7 +93,7 @@ class DemoRenderer
maColorBlack( vcl::unotools::colorToStdColorSpaceSequence( COL_BLACK) ), maColorBlack( vcl::unotools::colorToStdColorSpaceSequence( COL_BLACK) ),
maColorRed( vcl::unotools::colorToStdColorSpaceSequence( COL_RED) ), maColorRed( vcl::unotools::colorToStdColorSpaceSequence( COL_RED) ),
mxCanvas(xCanvas), mxCanvas(xCanvas),
mxDevice( xDevice ) mxDevice(std::move( xDevice ))
{ {
// Geometry init // Geometry init
geometry::AffineMatrix2D aUnit( 1,0, 0, geometry::AffineMatrix2D aUnit( 1,0, 0,

View File

@ -53,7 +53,7 @@ namespace canvas::tools
are not taken from the system's time base, but from are not taken from the system's time base, but from
the provided timer. the provided timer.
*/ */
ElapsedTime( std::shared_ptr<ElapsedTime> const & pTimeBase ); ElapsedTime( std::shared_ptr<ElapsedTime> xTimeBase );
/** Reset the time /** Reset the time