diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-13 16:36:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-13 19:25:02 +0100 |
commit | fb1825bf3f82eb6b69c6534207c9c89cc535f18b (patch) | |
tree | f8b98f5cb17ae087f44117c71efaa4ebfff27ce2 /canvas/source/vcl/canvasbitmaphelper.cxx | |
parent | 724d34d58b437843e40aaa74008d94cac1465cea (diff) |
loplugin:unusedmethods remove unused code from canvas
which my plugin had previously been ignoring. Since that time, the
plugin has gotten a little smarter, and makes less mistakes.
Change-Id: Id791c932fd056ae7da833436c4dd2600b69a0bfa
Reviewed-on: https://gerrit.libreoffice.org/51212
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas/source/vcl/canvasbitmaphelper.cxx')
-rw-r--r-- | canvas/source/vcl/canvasbitmaphelper.cxx | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index ac91c7493414..c2003f6a67cf 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -48,19 +48,6 @@ namespace vclcanvas { } - void CanvasBitmapHelper::setBitmap( const BitmapEx& rBitmap ) - { - ENSURE_OR_THROW( mpOutDevProvider, - "Invalid reference device" ); - - mpBackBuffer.reset( new BitmapBackBuffer( rBitmap, - mpOutDevProvider->getOutDev() ) ); - - // tell canvas helper about the new target OutDev (don't - // protect state, it's our own VirDev, anyways) - setOutDev( mpBackBuffer, false ); - } - void CanvasBitmapHelper::init( const BitmapEx& rBitmap, rendering::XGraphicDevice& rDevice, const OutDevProviderSharedPtr& rOutDevReference ) @@ -187,60 +174,6 @@ namespace vclcanvas return aRes; } - void CanvasBitmapHelper::setData( const uno::Sequence< sal_Int8 >& data, - const rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerRectangle2D& rect ) - { - SAL_INFO( "canvas.vcl", "::vclcanvas::CanvasBitmapHelper::setData()" ); - - if( !mpBackBuffer ) - return; // we're disposed - - const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() ); - ENSURE_ARG_OR_THROW( aRefLayout.PlaneStride != rLayout.PlaneStride || - aRefLayout.ColorSpace != rLayout.ColorSpace || - aRefLayout.Palette != rLayout.Palette || - aRefLayout.IsMsbFirst != rLayout.IsMsbFirst, - "Mismatching memory layout" ); - - // retrieve local copies from the BitmapEx, which are later - // stored back. Unfortunately, the BitmapEx does not permit - // in-place modifications, as they are necessary here. - - BitmapEx newBitmap = vcl::bitmap::CanvasBitmapHelperSetData(data, rect, mpBackBuffer->getBitmapReference()); - setBitmap( newBitmap ); - } - - void CanvasBitmapHelper::setPixel( const uno::Sequence< sal_Int8 >& color, - const rendering::IntegerBitmapLayout& rLayout, - const geometry::IntegerPoint2D& pos ) - { - SAL_INFO( "canvas.vcl", "::vclcanvas::CanvasBitmapHelper::setPixel()" ); - - if( !mpBackBuffer ) - return; // we're disposed - - const Size aBmpSize( mpBackBuffer->getBitmapReference().GetSizePixel() ); - - ENSURE_ARG_OR_THROW( pos.X >= 0 && pos.X < aBmpSize.Width(), - "X coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( pos.Y >= 0 && pos.Y < aBmpSize.Height(), - "Y coordinate out of bounds" ); - ENSURE_ARG_OR_THROW( color.getLength() > 3, - "not enough color components" ); - - const rendering::IntegerBitmapLayout aRefLayout( getMemoryLayout() ); - ENSURE_ARG_OR_THROW( aRefLayout.PlaneStride != rLayout.PlaneStride || - aRefLayout.ColorSpace != rLayout.ColorSpace || - aRefLayout.Palette != rLayout.Palette || - aRefLayout.IsMsbFirst != rLayout.IsMsbFirst, - "Mismatching memory layout" ); - - - BitmapEx newBitmapEx = vcl::bitmap::CanvasBitmapHelperSetPixel(color, pos, mpBackBuffer->getBitmapReference()); - setBitmap( newBitmapEx ); - } - uno::Sequence< sal_Int8 > CanvasBitmapHelper::getPixel( rendering::IntegerBitmapLayout& rLayout, const geometry::IntegerPoint2D& pos ) { |