From 12dbf0e6b6b485a1d73c7e33bd0ecfb13e6efdac Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Wed, 19 Jun 2024 16:03:06 -0400 Subject: tdf#159175 Do not allocate a CGLayer for each NSWindow when using Skia Skia surfaces can be copied directly to an NSWindow's CGContextRef so disable allocation of a CGLayer for each NSWindow to significantly reduce memory usage when Skia is enabled. Change-Id: I8e3001e4f2ae8dd36156c06db68447c6b1bc67df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169242 Tested-by: Jenkins Reviewed-by: Patrick Luby --- vcl/inc/skia/osx/gdiimpl.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vcl/inc/skia') diff --git a/vcl/inc/skia/osx/gdiimpl.hxx b/vcl/inc/skia/osx/gdiimpl.hxx index b97245e86e11..b60280a09e6b 100644 --- a/vcl/inc/skia/osx/gdiimpl.hxx +++ b/vcl/inc/skia/osx/gdiimpl.hxx @@ -44,11 +44,13 @@ public: virtual void Flush(const tools::Rectangle&) override; virtual void WindowBackingPropertiesChanged() override; + CGImageRef createCGImageFromRasterSurface(const NSRect& rDirtyRect, CGPoint& rImageOrigin, + bool& rImageFlipped); + private: virtual int getWindowScaling() const override; virtual void createWindowSurfaceInternal(bool forceRaster = false) override; virtual void flushSurfaceToWindowContext() override; - void flushSurfaceToScreenCG(); static inline sk_sp fontManager; }; -- cgit