summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-13 15:11:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-16 09:25:50 +0000
commit7dd6b261853ad53207fe5c367f98c4db1dfd54dc (patch)
tree076e35af0001bac6f1590ed77df5f0618a0740df /vcl/headless
parent8569c6d0ad70c32a08774fa6f5ec25b465ea98ee (diff)
use cairo-compatible top-down direction virtual devices everywhere
that way we can use cairo to text render etc onto our basebmp-backed headless/gtk3 virtual devices Change-Id: I91002b610b72a4fe1d2094a57c5cb1b6b5d69cb1 Reviewed-on: https://gerrit.libreoffice.org/19957 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpbmp.cxx4
-rw-r--r--vcl/headless/svpframe.cxx5
-rw-r--r--vcl/headless/svpinst.cxx4
-rw-r--r--vcl/headless/svpvd.cxx11
4 files changed, 10 insertions, 14 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index de06cd00ea00..4ae1afed0c4f 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -54,7 +54,7 @@ bool SvpSalBitmap::Create( const Size& rSize,
aSize.setY( 1 );
sal_Int32 nStride = getBitmapDeviceStrideForWidth(nFormat, aSize.getX());
if( nBitCount > 8 )
- m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride );
+ m_aBitmap = createBitmapDevice( aSize, true, nFormat, nStride );
else
{
// prepare palette
@@ -67,7 +67,7 @@ bool SvpSalBitmap::Create( const Size& rSize,
const BitmapColor& rCol = rPalette[i];
(*pPalette)[i] = basebmp::Color( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() );
}
- m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride,
+ m_aBitmap = createBitmapDevice( aSize, true, nFormat, nStride,
basebmp::RawMemorySharedArray(),
basebmp::PaletteMemorySharedVector( pPalette )
);
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index b881d2ca1e67..39f12506cda4 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -70,7 +70,6 @@ void SvpSalFrame::enableDamageTracker( bool bOn )
SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
SalFrameStyleFlags nSalFrameStyle,
- bool bTopDown,
basebmp::Format nScanlineFormat,
SystemParentData* ) :
m_pInstance( pInstance ),
@@ -78,7 +77,6 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
m_nStyle( nSalFrameStyle ),
m_bVisible( false ),
#ifndef IOS
- m_bTopDown( bTopDown ),
m_bDamageTracking( false ),
m_nScanlineFormat( nScanlineFormat ),
#endif
@@ -92,7 +90,6 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance,
memset( static_cast<void *>(&m_aSystemChildData), 0, sizeof( SystemEnvData ) );
m_aSystemChildData.nSize = sizeof( SystemEnvData );
#ifdef IOS
- (void) bTopDown;
(void) nScanlineFormat;
#elif defined ANDROID
// Nothing
@@ -295,7 +292,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
if( aFrameSize.getY() == 0 )
aFrameSize.setY( 1 );
sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(m_nScanlineFormat, aFrameSize.getX());
- m_aFrame = createBitmapDevice( aFrameSize, m_bTopDown, m_nScanlineFormat, nStride );
+ m_aFrame = createBitmapDevice( aFrameSize, true, m_nScanlineFormat, nStride );
if (m_bDamageTracking)
m_aFrame->setDamageTracker(
basebmp::IBitmapDeviceDamageTrackerSharedPtr( new DamageTracker ) );
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 0d3aa65d3805..c5df6b760863 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -200,12 +200,12 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle )
{
- return new SvpSalFrame( this, nullptr, nStyle, false, SVP_DEFAULT_BITMAP_FORMAT, pParent );
+ return new SvpSalFrame( this, nullptr, nStyle, SVP_DEFAULT_BITMAP_FORMAT, pParent );
}
SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
{
- return new SvpSalFrame( this, pParent, nStyle, false, SVP_DEFAULT_BITMAP_FORMAT );
+ return new SvpSalFrame( this, pParent, nStyle, SVP_DEFAULT_BITMAP_FORMAT );
}
void SvpSalInstance::DestroyFrame( SalFrame* pFrame )
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 4ed3fc5909a2..fab2c153fa49 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -52,12 +52,11 @@ void SvpSalVirtualDevice::ReleaseGraphics( SalGraphics* pGraphics )
bool SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
{
- return SetSizeUsingBuffer( nNewDX, nNewDY, basebmp::RawMemorySharedArray(), false );
+ return SetSizeUsingBuffer(nNewDX, nNewDY, basebmp::RawMemorySharedArray());
}
bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
- const basebmp::RawMemorySharedArray &pBuffer,
- const bool bTopDown )
+ const basebmp::RawMemorySharedArray &pBuffer )
{
B2IVector aDevSize( nNewDX, nNewDY );
if( aDevSize.getX() == 0 )
@@ -76,14 +75,14 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
std::vector< basebmp::Color > aDevPal(2);
aDevPal[0] = basebmp::Color( 0, 0, 0 );
aDevPal[1] = basebmp::Color( 0xff, 0xff, 0xff );
- m_aDevice = createBitmapDevice( aDevSize, bTopDown, nFormat, nStride,
+ m_aDevice = createBitmapDevice( aDevSize, true, nFormat, nStride,
PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) );
}
else
{
m_aDevice = pBuffer ?
- createBitmapDevice( aDevSize, bTopDown, nFormat, nStride, pBuffer, PaletteMemorySharedVector() )
- : createBitmapDevice( aDevSize, bTopDown, nFormat, nStride );
+ createBitmapDevice( aDevSize, true, nFormat, nStride, pBuffer, PaletteMemorySharedVector() )
+ : createBitmapDevice( aDevSize, true, nFormat, nStride );
}
// update device in existing graphics