summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-29 15:11:48 +0100
committerTor Lillqvist <tml@collabora.com>2016-03-20 22:06:24 +0200
commit4e195870ec16086ef31a51f65af0d7cbfeea723d (patch)
treee2a4ebbeb2db0f9280fca35516da6904fa952a2a /vcl
parentdf63131bfa652328f5b46bd638eb6f88deeeadf6 (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 (cherry picked from commit edaccf928c4e4e90a024e766aecd07181e29fd97)
Diffstat (limited to 'vcl')
-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();