diff options
-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(); |