simplify VirtualDevice::InnerImplSetOutputSizePixel
the pBuffer param is unused Change-Id: I4185d7b573734afc1a3e3903f8f30811b2d00750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -55,8 +55,7 @@ private:
|
|||||||
bool mbForceZeroExtleadBug;
|
bool mbForceZeroExtleadBug;
|
||||||
|
|
||||||
SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, tools::Long nDX, tools::Long nDY, const SystemGraphicsData *pData = nullptr );
|
SAL_DLLPRIVATE void ImplInitVirDev( const OutputDevice* pOutDev, tools::Long nDX, tools::Long nDY, const SystemGraphicsData *pData = nullptr );
|
||||||
SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
|
SAL_DLLPRIVATE bool InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase );
|
||||||
sal_uInt8* pBuffer );
|
|
||||||
|
|
||||||
VirtualDevice (const VirtualDevice &) = delete;
|
VirtualDevice (const VirtualDevice &) = delete;
|
||||||
VirtualDevice & operator= (const VirtualDevice &) = delete;
|
VirtualDevice & operator= (const VirtualDevice &) = delete;
|
||||||
|
@@ -254,8 +254,7 @@ void VirtualDevice::dispose()
|
|||||||
OutputDevice::dispose();
|
OutputDevice::dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
|
bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase)
|
||||||
sal_uInt8 *const pBuffer)
|
|
||||||
{
|
{
|
||||||
SAL_INFO( "vcl.virdev",
|
SAL_INFO( "vcl.virdev",
|
||||||
"VirtualDevice::InnerImplSetOutputSizePixel( " << rNewSize.Width() << ", "
|
"VirtualDevice::InnerImplSetOutputSizePixel( " << rNewSize.Width() << ", "
|
||||||
@@ -282,11 +281,7 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
|
|||||||
|
|
||||||
if ( bErase )
|
if ( bErase )
|
||||||
{
|
{
|
||||||
if ( pBuffer )
|
|
||||||
bRet = mpVirDev->SetSizeUsingBuffer( nNewWidth, nNewHeight, pBuffer );
|
|
||||||
else
|
|
||||||
bRet = mpVirDev->SetSize( nNewWidth, nNewHeight );
|
bRet = mpVirDev->SetSize( nNewWidth, nNewHeight );
|
||||||
|
|
||||||
if ( bRet )
|
if ( bRet )
|
||||||
{
|
{
|
||||||
mnOutWidth = rNewSize.Width();
|
mnOutWidth = rNewSize.Width();
|
||||||
@@ -296,7 +291,6 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(!pBuffer && "passing pBuffer without bErase is not supported");
|
|
||||||
std::unique_ptr<SalVirtualDevice> pNewVirDev;
|
std::unique_ptr<SalVirtualDevice> pNewVirDev;
|
||||||
ImplSVData* pSVData = ImplGetSVData();
|
ImplSVData* pSVData = ImplGetSVData();
|
||||||
|
|
||||||
@@ -359,7 +353,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const tools::Rectangle& rRect )
|
|||||||
|
|
||||||
bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase, bool bAlphaMaskTransparent )
|
bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase, bool bAlphaMaskTransparent )
|
||||||
{
|
{
|
||||||
if( InnerImplSetOutputSizePixel(rNewSize, bErase, /*pBuffer*/nullptr) )
|
if( InnerImplSetOutputSizePixel(rNewSize, bErase) )
|
||||||
{
|
{
|
||||||
if (meFormatAndAlpha != DeviceFormat::WITHOUT_ALPHA)
|
if (meFormatAndAlpha != DeviceFormat::WITHOUT_ALPHA)
|
||||||
{
|
{
|
||||||
@@ -372,7 +366,7 @@ bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase, bool
|
|||||||
if( !mpAlphaVDev )
|
if( !mpAlphaVDev )
|
||||||
{
|
{
|
||||||
mpAlphaVDev = VclPtr<VirtualDevice>::Create(*this, meFormatAndAlpha);
|
mpAlphaVDev = VclPtr<VirtualDevice>::Create(*this, meFormatAndAlpha);
|
||||||
mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase, nullptr);
|
mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase);
|
||||||
mpAlphaVDev->SetBackground( Wallpaper(bAlphaMaskTransparent ? COL_ALPHA_TRANSPARENT : COL_ALPHA_OPAQUE) );
|
mpAlphaVDev->SetBackground( Wallpaper(bAlphaMaskTransparent ? COL_ALPHA_TRANSPARENT : COL_ALPHA_OPAQUE) );
|
||||||
mpAlphaVDev->Erase();
|
mpAlphaVDev->Erase();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user