From 3cd6485ee95ed2b2c4cf8cd7b45a573a0aced175 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 10 Jan 2017 09:31:27 +0000 Subject: BitmapWriteAccess* -> Bitmap::ScopedWriteAccess Change-Id: I5b3980d8eecc61a6f63aa64a1b05c30afa2f57f7 --- vcl/source/gdi/pngread.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 1d4a6c343eae..8b006751f613 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -76,7 +76,7 @@ private: std::vector::iterator maDataIter; std::unique_ptr mpBmp; - BitmapWriteAccess* mpAcc; + Bitmap::ScopedWriteAccess mpAcc; std::unique_ptr mpMaskBmp; std::unique_ptr mpAlphaMask; BitmapWriteAccess* mpMaskAcc; @@ -167,7 +167,6 @@ public: PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) : mrPNGStream( rPNGStream ), - mpAcc ( nullptr ), mpMaskAcc ( nullptr ), mpInflateInBuf ( nullptr ), mpScanPrior ( nullptr ), @@ -419,11 +418,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) } // release write access of the bitmaps - if ( mpAcc ) - { - Bitmap::ReleaseAccess( mpAcc ); - mpAcc = nullptr; - } + mpAcc.reset(); if ( mpMaskAcc ) { @@ -662,7 +657,7 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) return false; mpBmp = o3tl::make_unique( maTargetSize, mnTargetDepth ); - mpAcc = mpBmp->AcquireWriteAccess(); + mpAcc = Bitmap::ScopedWriteAccess(*mpBmp); if( !mpAcc ) return false; @@ -1120,9 +1115,9 @@ void PNGReaderImpl::ImplApplyFilter() namespace { - void SanitizePaletteIndexes(sal_uInt8* pEntries, int nLen, BitmapWriteAccess* pAcc) + void SanitizePaletteIndexes(sal_uInt8* pEntries, int nLen, const Bitmap::ScopedWriteAccess& rAcc) { - sal_uInt16 nPaletteEntryCount = pAcc->GetPaletteEntryCount(); + sal_uInt16 nPaletteEntryCount = rAcc->GetPaletteEntryCount(); for (int nX = 0; nX < nLen; ++nX) { if (pEntries[nX] >= nPaletteEntryCount) -- cgit ro/collabora/cd-5.3-3.1'>distro/collabora/cd-5.3-3.1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2015-02-05Icon theme compressionAndrew
2014-02-27Lots of Tango icon changesMirek Mazel