diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-15 12:43:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-15 14:33:52 +0100 |
commit | 52fece12345161911da2a531213b7d5541192aad (patch) | |
tree | fd27e700dc56ca5293e88746dbeed7cc08a57f3a /vcl/source/graphic | |
parent | 0a76eb059a77c799e6ce8400c558fc4dd1d866aa (diff) |
tweak GetBitmap methods in BitmapEx
so we return a const& for the normal case, just like other methods,
which reduces copying.
This revealed that CreateDisplayBitmap in Bitmap can be const.
Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/graphic')
-rw-r--r-- | vcl/source/graphic/UnoGraphicTransformer.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vcl/source/graphic/UnoGraphicTransformer.cxx b/vcl/source/graphic/UnoGraphicTransformer.cxx index 30fd389b9485..2a7f6eef5a42 100644 --- a/vcl/source/graphic/UnoGraphicTransformer.cxx +++ b/vcl/source/graphic/UnoGraphicTransformer.cxx @@ -112,13 +112,11 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone( BitmapEx aBitmapEx( aGraphic.GetBitmapEx() ); AlphaMask aMask( aBitmapEx.GetAlpha() ); - Bitmap aBitmap( aBitmapEx.GetBitmap() ); - BitmapEx aTmpBmpEx(aBitmap); + BitmapEx aTmpBmpEx(aBitmapEx.GetBitmap()); BitmapFilter::Filter(aTmpBmpEx, BitmapDuoToneFilter(static_cast<sal_uLong>(nColorOne), static_cast<sal_uLong>(nColorTwo))); - aBitmap = aTmpBmpEx.GetBitmap(); - aReturnGraphic = ::Graphic( BitmapEx( aBitmap, aMask ) ); + aReturnGraphic = ::Graphic( BitmapEx( aTmpBmpEx.GetBitmap(), aMask ) ); aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); return aReturnGraphic.GetXGraphic(); } |