diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-01 14:17:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-01 16:45:23 +0200 |
commit | 1d3b613318654ceb2d34996ef8ca653cfe32a8ea (patch) | |
tree | a996b2c83a430af3a88a5af91daed6f7c1817e52 /vcl/source/gdi/virdev.cxx | |
parent | ded566addabf4e6813d22b14de4fb8ce8405d491 (diff) |
desktop, vcl: support transparency in VirtualDevices with user-provided memory
Change-Id: I65c31995c02a644aa436aecd065255fab38045e4
Diffstat (limited to 'vcl/source/gdi/virdev.cxx')
-rw-r--r-- | vcl/source/gdi/virdev.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 7319a1f056af..5cdb7066bddd 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -393,6 +393,7 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect ) bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer, + const basebmp::RawMemorySharedArray &pAlphaBuffer, const bool bTopDown ) { if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer, bTopDown) ) @@ -409,7 +410,7 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, { mpAlphaVDev = VclPtr<VirtualDevice>::Create( *this, mnAlphaDepth ); mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase, - basebmp::RawMemorySharedArray(), + pAlphaBuffer, bTopDown ); } @@ -443,13 +444,16 @@ void VirtualDevice::EnableRTL( bool bEnable ) bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase ) { - return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), false ); + return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), basebmp::RawMemorySharedArray(), false ); } bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, - const basebmp::RawMemorySharedArray &pBuffer, const bool bTopDown ) + const basebmp::RawMemorySharedArray &pBuffer, const basebmp::RawMemorySharedArray &pAlphaBuffer, const bool bTopDown ) { + if (pAlphaBuffer) + mnAlphaDepth = 8; + if (pBuffer) { MapMode mm = GetMapMode(); mm.SetOrigin( rNewOffset ); @@ -457,7 +461,7 @@ bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer( mm.SetScaleY( rScale ); SetMapMode( mm ); } - return ImplSetOutputSizePixel( rNewSize, true, pBuffer, bTopDown ); + return ImplSetOutputSizePixel( rNewSize, true, pBuffer, pAlphaBuffer, bTopDown ); } void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode ) |