diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2016-01-29 15:11:48 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2016-02-08 21:08:15 +0000 |
commit | 4bae5148842115d860b5392b98ff8121b468ac4c (patch) | |
tree | dee3a582602efc1bc66137d40b535f27efaa51bc /vcl/headless/svpframe.cxx | |
parent | ce81a477d228277f44e96356e85d92467eb7a0b9 (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
Reviewed-on: https://gerrit.libreoffice.org/21918
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/headless/svpframe.cxx')
-rw-r--r-- | vcl/headless/svpframe.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 42e181e39eec..e8536edc66be 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -262,9 +262,14 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u if (m_pSurface) cairo_surface_destroy(m_pSurface); + + // Creating backing surfaces for invisible windows costs a big chunk of RAM. + if (Application::IsHeadlessModeEnabled()) + aFrameSize = B2IVector( 1, 1 ); + m_pSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - aFrameSize.getX(), - aFrameSize.getY()); + aFrameSize.getX(), + aFrameSize.getY()); // update device in existing graphics for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin(); |