Kaydet (Commit) 3cd6485e authored tarafından Caolán McNamara's avatar Caolán McNamara

BitmapWriteAccess* -> Bitmap::ScopedWriteAccess

Change-Id: I5b3980d8eecc61a6f63aa64a1b05c30afa2f57f7
üst b3bddf8b
...@@ -76,7 +76,7 @@ private: ...@@ -76,7 +76,7 @@ private:
std::vector<sal_uInt8>::iterator maDataIter; std::vector<sal_uInt8>::iterator maDataIter;
std::unique_ptr<Bitmap> mpBmp; std::unique_ptr<Bitmap> mpBmp;
BitmapWriteAccess* mpAcc; Bitmap::ScopedWriteAccess mpAcc;
std::unique_ptr<Bitmap> mpMaskBmp; std::unique_ptr<Bitmap> mpMaskBmp;
std::unique_ptr<AlphaMask> mpAlphaMask; std::unique_ptr<AlphaMask> mpAlphaMask;
BitmapWriteAccess* mpMaskAcc; BitmapWriteAccess* mpMaskAcc;
...@@ -167,7 +167,6 @@ public: ...@@ -167,7 +167,6 @@ public:
PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
: mrPNGStream( rPNGStream ), : mrPNGStream( rPNGStream ),
mpAcc ( nullptr ),
mpMaskAcc ( nullptr ), mpMaskAcc ( nullptr ),
mpInflateInBuf ( nullptr ), mpInflateInBuf ( nullptr ),
mpScanPrior ( nullptr ), mpScanPrior ( nullptr ),
...@@ -419,11 +418,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) ...@@ -419,11 +418,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
} }
// release write access of the bitmaps // release write access of the bitmaps
if ( mpAcc ) mpAcc.reset();
{
Bitmap::ReleaseAccess( mpAcc );
mpAcc = nullptr;
}
if ( mpMaskAcc ) if ( mpMaskAcc )
{ {
...@@ -662,7 +657,7 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) ...@@ -662,7 +657,7 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
return false; return false;
mpBmp = o3tl::make_unique<Bitmap>( maTargetSize, mnTargetDepth ); mpBmp = o3tl::make_unique<Bitmap>( maTargetSize, mnTargetDepth );
mpAcc = mpBmp->AcquireWriteAccess(); mpAcc = Bitmap::ScopedWriteAccess(*mpBmp);
if( !mpAcc ) if( !mpAcc )
return false; return false;
...@@ -1120,9 +1115,9 @@ void PNGReaderImpl::ImplApplyFilter() ...@@ -1120,9 +1115,9 @@ void PNGReaderImpl::ImplApplyFilter()
namespace 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) for (int nX = 0; nX < nLen; ++nX)
{ {
if (pEntries[nX] >= nPaletteEntryCount) if (pEntries[nX] >= nPaletteEntryCount)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment