diff options
-rw-r--r-- | vcl/inc/impgraph.hxx | 11 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 44 | ||||
-rw-r--r-- | vcl/source/graphic/Manager.cxx | 6 |
3 files changed, 31 insertions, 30 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 8fa1df9b82fc..8dc3e21de640 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -175,13 +175,14 @@ private: bool ImplReadEmbedded( SvStream& rIStream ); bool ImplWriteEmbedded( SvStream& rOStream ); - bool ImplSwapIn(); - bool ImplSwapIn( SvStream* pIStm ); + bool swapIn(); + bool swapInFromStream(SvStream* pIStm); - bool ImplSwapOut(); - bool ImplSwapOut( SvStream* pOStm ); + bool swapOut(); + bool swapOutToStream(SvStream* pOStm); + + bool isSwappedOut() const { return mbSwapOut;} - bool ImplIsSwapOut() const { return mbSwapOut;} bool ImplIsDummyContext() const { return mbDummyContext; } void ImplSetLink( const std::shared_ptr<GfxLink>& ); std::shared_ptr<GfxLink> ImplGetSharedGfxLink() const; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index dd4f2cdebd58..8eb9e0346dd0 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -330,7 +330,7 @@ const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() con void ImpGraphic::ImplCreateSwapInfo() { - if (!ImplIsSwapOut()) + if (!isSwappedOut()) { maSwapInfo.maPrefMapMode = ImplGetPrefMapMode(); maSwapInfo.maPrefSize = ImplGetPrefSize(); @@ -737,7 +737,7 @@ Size ImpGraphic::ImplGetSizePixel() const { Size aSize; - if (ImplIsSwapOut()) + if (isSwappedOut()) aSize = maSwapInfo.maSizePixel; else aSize = ImplGetBitmapEx(GraphicConversionParameters()).GetSizePixel(); @@ -749,7 +749,7 @@ Size ImpGraphic::ImplGetPrefSize() const { Size aSize; - if (ImplIsSwapOut()) + if (isSwappedOut()) { aSize = maSwapInfo.maPrefSize; } @@ -847,7 +847,7 @@ MapMode ImpGraphic::ImplGetPrefMapMode() const { MapMode aMapMode; - if (ImplIsSwapOut()) + if (isSwappedOut()) { aMapMode = maSwapInfo.maPrefMapMode; } @@ -963,7 +963,7 @@ sal_uLong ImpGraphic::ImplGetSizeBytes() const void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt ) const { ensureAvailable(); - if( !ImplIsSupportedGraphic() || ImplIsSwapOut() ) + if( !ImplIsSupportedGraphic() || isSwappedOut() ) return; switch( meType ) @@ -1000,7 +1000,7 @@ void ImpGraphic::ImplDraw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSize ) const { ensureAvailable(); - if( !ImplIsSupportedGraphic() || ImplIsSwapOut() ) + if( !ImplIsSupportedGraphic() || isSwappedOut() ) return; switch( meType ) @@ -1043,7 +1043,7 @@ void ImpGraphic::ImplStartAnimation( OutputDevice* pOutDev, const Point& rDestPt { ensureAvailable(); - if( ImplIsSupportedGraphic() && !ImplIsSwapOut() && mpAnimation ) + if( ImplIsSupportedGraphic() && !isSwappedOut() && mpAnimation ) mpAnimation->Start( pOutDev, rDestPt, rDestSize, nExtraData, pFirstFrameOutDev ); } @@ -1051,7 +1051,7 @@ void ImpGraphic::ImplStopAnimation( OutputDevice* pOutDev, long nExtraData ) { ensureAvailable(); - if( ImplIsSupportedGraphic() && !ImplIsSwapOut() && mpAnimation ) + if( ImplIsSupportedGraphic() && !isSwappedOut() && mpAnimation ) mpAnimation->Stop( pOutDev, nExtraData ); } @@ -1227,7 +1227,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) { ensureAvailable(); - if( ( meType == GraphicType::NONE ) || ( meType == GraphicType::Default ) || ImplIsSwapOut() ) + if( ( meType == GraphicType::NONE ) || ( meType == GraphicType::Default ) || isSwappedOut() ) return false; const MapMode aMapMode( ImplGetPrefMapMode() ); @@ -1300,10 +1300,10 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) return bRet; } -bool ImpGraphic::ImplSwapOut() +bool ImpGraphic::swapOut() { - if( ImplIsSwapOut() ) + if( isSwappedOut() ) return false; ::utl::TempFile aTempFile; @@ -1326,7 +1326,7 @@ bool ImpGraphic::ImplSwapOut() xOStm->SetVersion( SOFFICE_FILEFORMAT_50 ); xOStm->SetCompressMode( SvStreamCompressFlags::NATIVE ); - bool bRet = ImplSwapOut( xOStm.get() ); + bool bRet = swapOutToStream( xOStm.get() ); if( bRet ) { mpSwapFile.reset(new ImpSwapFile, o3tl::default_delete<ImpSwapFile>()); @@ -1344,7 +1344,7 @@ bool ImpGraphic::ImplSwapOut() return bRet; } -bool ImpGraphic::ImplSwapOut( SvStream* xOStm ) +bool ImpGraphic::swapOutToStream(SvStream* xOStm) { if( !xOStm ) { @@ -1375,8 +1375,8 @@ bool ImpGraphic::ensureAvailable() const { auto pThis = const_cast<ImpGraphic*>(this); - if (ImplIsSwapOut()) - return pThis->ImplSwapIn(); + if (isSwappedOut()) + return pThis->swapIn(); pThis->maLastUsed = std::chrono::high_resolution_clock::now(); return true; @@ -1405,11 +1405,11 @@ bool ImpGraphic::loadPrepared() return true; } -bool ImpGraphic::ImplSwapIn() +bool ImpGraphic::swapIn() { bool bRet = false; - if (!ImplIsSwapOut()) + if (!isSwappedOut()) return bRet; if (mbPrepared) @@ -1439,7 +1439,7 @@ bool ImpGraphic::ImplSwapIn() xIStm->SetVersion( SOFFICE_FILEFORMAT_50 ); xIStm->SetCompressMode( SvStreamCompressFlags::NATIVE ); - bRet = ImplSwapIn( xIStm.get() ); + bRet = swapInFromStream(xIStm.get()); xIStm.reset(); if (mpSwapFile) setOriginURL(mpSwapFile->maOriginURL); @@ -1454,7 +1454,7 @@ bool ImpGraphic::ImplSwapIn() return bRet; } -bool ImpGraphic::ImplSwapIn( SvStream* xIStm ) +bool ImpGraphic::swapInFromStream(SvStream* xIStm) { bool bRet = false; @@ -1528,7 +1528,7 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const ensureAvailable(); - if( ImplIsSupportedGraphic() && !ImplIsSwapOut() ) + if( ImplIsSupportedGraphic() && !isSwappedOut() ) { switch( meType ) { @@ -1565,7 +1565,7 @@ bool ImpGraphic::ImplExportNative( SvStream& rOStm ) const bool bResult = false; - if( !ImplIsSwapOut() ) + if( !isSwappedOut() ) { if( mpGfxLink && mpGfxLink->IsNative() ) bResult = mpGfxLink->ExportNative( rOStm ); @@ -1758,7 +1758,7 @@ void WriteImpGraphic(SvStream& rOStm, const ImpGraphic& rImpGraphic) rImpGraphic.ensureAvailable(); - if (rImpGraphic.ImplIsSwapOut()) + if (rImpGraphic.isSwappedOut()) { rOStm.SetError( SVSTREAM_GENERALERROR ); return; diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index b019d5adceaa..65e81fc1e605 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -93,7 +93,7 @@ void Manager::reduceGraphicMemory() return; sal_Int64 nCurrentGraphicSize = getGraphicSizeBytes(pEachImpGraphic); - if (!pEachImpGraphic->ImplIsSwapOut() && nCurrentGraphicSize > 1000000) + if (!pEachImpGraphic->isSwappedOut() && nCurrentGraphicSize > 1000000) { if (!pEachImpGraphic->mpContext) { @@ -102,7 +102,7 @@ void Manager::reduceGraphicMemory() auto aSeconds = std::chrono::duration_cast<std::chrono::seconds>(aDeltaTime); if (aSeconds > mnAllowedIdleTime) - pEachImpGraphic->ImplSwapOut(); + pEachImpGraphic->swapOut(); } } } @@ -141,7 +141,7 @@ void Manager::registerGraphic(const std::shared_ptr<ImpGraphic>& pImpGraphic, sal_Int64 calculatedSize = 0; for (ImpGraphic* pEachImpGraphic : m_pImpGraphicList) { - if (!pEachImpGraphic->ImplIsSwapOut()) + if (!pEachImpGraphic->isSwappedOut()) { calculatedSize += getGraphicSizeBytes(pEachImpGraphic); } |