summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-05-25 16:40:47 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-25 13:04:29 +0100
commit56fea375b915bb96012b36012634523b9806040a (patch)
tree291c2de2f0599b2302a95068bda1b98585fc1b51 /vcl/source
parent01bd2bd371051e9dcab0cd15db43a607d5f12b63 (diff)
Allow passing in external buffers to svp's VirtualDevice.
We also want to be able to set whether or not the buffers should be painted to top down, so add that parameter as necessary (default seems to be false, however e.g. gtk requires this to be true, i.e. needed for tiled rendering). Change-Id: Id98882e4c7f62508ae5a976c0d8df743460a4ab2
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/virdev.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 6378785526ef..54cd376c0ce0 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -267,7 +267,9 @@ VirtualDevice::~VirtualDevice()
pSVData->maGDIData.mpLastVirDev = mpPrev;
}
-bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer )
+bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
+ const basebmp::RawMemorySharedArray &pBuffer,
+ const bool bTopDown )
{
SAL_INFO( "vcl.gdi",
"VirtualDevice::InnerImplSetOutputSizePixel( " << rNewSize.Width() << ", "
@@ -296,7 +298,7 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
if ( bErase )
{
if ( pBuffer )
- bRet = mpVirDev->SetSizeUsingBuffer( nNewWidth, nNewHeight, pBuffer );
+ bRet = mpVirDev->SetSizeUsingBuffer( nNewWidth, nNewHeight, pBuffer, bTopDown );
else
bRet = mpVirDev->SetSize( nNewWidth, nNewHeight );
@@ -381,9 +383,11 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
Pop();
}
-bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer )
+bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase,
+ const basebmp::RawMemorySharedArray &pBuffer,
+ const bool bTopDown )
{
- if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer) )
+ if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer, bTopDown) )
{
if( mnAlphaDepth != -1 )
{
@@ -397,7 +401,9 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, c
if( !mpAlphaVDev )
{
mpAlphaVDev = new VirtualDevice( *this, mnAlphaDepth );
- mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase, basebmp::RawMemorySharedArray() );
+ mpAlphaVDev->InnerImplSetOutputSizePixel(rNewSize, bErase,
+ basebmp::RawMemorySharedArray(),
+ bTopDown );
}
// TODO: copy full outdev state to new one, here. Also needed in outdev2.cxx:DrawOutDev
@@ -430,10 +436,12 @@ void VirtualDevice::EnableRTL( bool bEnable )
bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase )
{
- return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray() );
+ return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray(), false );
}
-bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, const basebmp::RawMemorySharedArray &pBuffer )
+bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer(
+ const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset,
+ const basebmp::RawMemorySharedArray &pBuffer, const bool bTopDown )
{
if (pBuffer) {
MapMode mm = GetMapMode();
@@ -442,7 +450,7 @@ bool VirtualDevice::SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize
mm.SetScaleY( rScale );
SetMapMode( mm );
}
- return ImplSetOutputSizePixel( rNewSize, true, pBuffer);
+ return ImplSetOutputSizePixel( rNewSize, true, pBuffer, bTopDown );
}
void VirtualDevice::SetReferenceDevice( RefDevMode i_eRefDevMode )