summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-29 15:11:48 +0100
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-01-29 21:00:07 -0500
commitedaccf928c4e4e90a024e766aecd07181e29fd97 (patch)
tree420037b515194fcb61424e074ac9d2abd3e8b142
parent26d69c1c0321a657d159b5c850044df1aa317d43 (diff)
headless: for now don't allocate big cairo surfaces for invisible frames.
This was ~10Mb of RAM for a hello-world.odt under tile-bench. Change-Id: Ie0787676be754ac81eb8ec036c9757a1bb2f2220
-rw-r--r--vcl/headless/svpframe.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index e1218d7ab3e6..56e9dd9275e9 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -292,10 +292,16 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
aFrameSize.setX( 1 );
if( aFrameSize.getY() == 0 )
aFrameSize.setY( 1 );
+
+ // Creating backing surfaces for invisible windows costs a big chunk of RAM.
+ if (Application::IsHeadlessModeEnabled())
+ aFrameSize = B2IVector( 1, 1 );
+
sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(m_nScanlineFormat, aFrameSize.getX());
m_aFrame = createBitmapDevice( aFrameSize, m_bTopDown, m_nScanlineFormat, nStride );
if (m_bDamageTracking)
m_aFrame->setDamageTracker(
+
basebmp::IBitmapDeviceDamageTrackerSharedPtr( new DamageTracker ) );
// update device in existing graphics
for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin();