[Libreoffice-commits] core.git: vcl/headless

Michael Meeks michael.meeks at collabora.com
Mon Feb 8 21:08:36 UTC 2016


 vcl/headless/svpframe.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 4bae5148842115d860b5392b98ff8121b468ac4c
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Jan 29 15:11:48 2016 +0100

    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 at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 42e181e..e8536ed 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();


More information about the Libreoffice-commits mailing list