diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2024-06-19 16:03:06 -0400 |
---|---|---|
committer | Patrick Luby <guibomacdev@gmail.com> | 2024-06-25 21:34:25 +0200 |
commit | 12dbf0e6b6b485a1d73c7e33bd0ecfb13e6efdac (patch) | |
tree | c66d234c4e4ba9772e3ddc20237d0811b28b965c /vcl/osx/salmacos.cxx | |
parent | 4acedb794c1ba0de24f2c8703e07d7f2d5143bdb (diff) |
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 <guibomacdev@gmail.com>
Diffstat (limited to 'vcl/osx/salmacos.cxx')
-rw-r--r-- | vcl/osx/salmacos.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx index 700b252cf4f3..14e2a80695d9 100644 --- a/vcl/osx/salmacos.cxx +++ b/vcl/osx/salmacos.cxx @@ -26,6 +26,7 @@ #include <osl/diagnose.h> #include <vcl/bitmap.hxx> +#include <vcl/skia/SkiaHelper.hxx> #include <quartz/salbmp.h> #include <quartz/salgdi.h> @@ -506,6 +507,12 @@ bool AquaSalVirtualDevice::SetSize(tools::Long nDX, tools::Long nDY) nFlags = uint32_t(kCGImageAlphaNoneSkipFirst) | uint32_t(kCGBitmapByteOrder32Host); } + if (SkiaHelper::isVCLSkiaEnabled()) + { + mpGraphics->SetVirDevGraphics(this, maLayer, nullptr, mnBitmapDepth); + return true; + } + // Allocate buffer for virtual device graphics as bitmap context to store graphics with highest required (scaled) resolution size_t nScaledWidth = mnWidth * fScale; |