Bugzilla – Attachment 194810 Details for
Bug 159175
macOS: instruments dectect leaks when open new calc document 5 times
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Debug patch that limits CGLayers and their underlying CGBitmaps to only 1x1 pixels
no-cglayer-allocations.diff (text/plain), 5.34 KB, created by
Patrick Luby (volunteer)
on 2024-06-19 00:32:29 UTC
(
hide
)
Description:
Debug patch that limits CGLayers and their underlying CGBitmaps to only 1x1 pixels
Filename:
MIME Type:
Creator:
Patrick Luby (volunteer)
Created:
2024-06-19 00:32:29 UTC
Size:
5.34 KB
patch
obsolete
>diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx >index a9445293211c..afbaf3f5bb41 100644 >--- a/vcl/osx/salgdiutils.cxx >+++ b/vcl/osx/salgdiutils.cxx >@@ -237,24 +237,27 @@ bool AquaSharedAttributes::checkContext() > { > const int nBitmapDepth = 32; > >- float nScaledWidth = mnWidth * fScale; >+ // float nScaledWidth = mnWidth * fScale; > float nScaledHeight = mnHeight * fScale; > >- const CGSize aLayerSize = { static_cast<CGFloat>(nScaledWidth), static_cast<CGFloat>(nScaledHeight) }; >+ // const CGSize aLayerSize = { static_cast<CGFloat>(nScaledWidth), static_cast<CGFloat>(nScaledHeight) }; > >- const int nBytesPerRow = (nBitmapDepth * nScaledWidth) / 8; >+ // const int nBytesPerRow = (nBitmapDepth * nScaledWidth) / 8; > std::uint32_t nFlags = std::uint32_t(kCGImageAlphaNoneSkipFirst) > | std::uint32_t(kCGBitmapByteOrder32Host); > maBGContextHolder.set(CGBitmapContextCreate( >- nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, GetSalData()->mxRGBSpace, nFlags)); >+ // nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, GetSalData()->mxRGBSpace, nFlags)); >+ nullptr, 1, 1, 8, nBitmapDepth / 8, GetSalData()->mxRGBSpace, nFlags)); > >- maLayer.set(CGLayerCreateWithContext(maBGContextHolder.get(), aLayerSize, nullptr)); >+ // maLayer.set(CGLayerCreateWithContext(maBGContextHolder.get(), aLayerSize, nullptr)); >+ maLayer.set(CGLayerCreateWithContext(maBGContextHolder.get(), CGSizeMake(1, 1), nullptr)); > maLayer.setScale(fScale); > > nFlags = std::uint32_t(kCGImageAlphaPremultipliedFirst) > | std::uint32_t(kCGBitmapByteOrder32Host); > maCSContextHolder.set(CGBitmapContextCreate( >- nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, GetSalData()->mxRGBSpace, nFlags)); >+ // nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, GetSalData()->mxRGBSpace, nFlags)); >+ nullptr, 1, 1, 8, nBitmapDepth / 8, GetSalData()->mxRGBSpace, nFlags)); > > CGContextRef xDrawContext = CGLayerGetContext(maLayer.get()); > maContextHolder = xDrawContext; >diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx >index 700b252cf4f3..c810fcb94582 100644 >--- a/vcl/osx/salmacos.cxx >+++ b/vcl/osx/salmacos.cxx >@@ -183,8 +183,9 @@ void AquaGraphicsBackend::copyScaledArea(tools::Long nDstX, tools::Long nDstY,to > // thereafter. > > CGLayerHolder aSourceLayerHolder(pSrcShared->maLayer); >- const CGSize aSourceSize = CGSizeMake(nScaledSourceWidth, nScaledSourceHeight); >- aSourceLayerHolder.set(CGLayerCreateWithContext(xCopyContext, aSourceSize, nullptr)); >+ // const CGSize aSourceSize = CGSizeMake(nScaledSourceWidth, nScaledSourceHeight); >+ // aSourceLayerHolder.set(CGLayerCreateWithContext(xCopyContext, aSourceSize, nullptr)); >+ aSourceLayerHolder.set(CGLayerCreateWithContext(xCopyContext, CGSizeMake(1, 1), nullptr)); > const CGContextRef xSourceContext = CGLayerGetContext(aSourceLayerHolder.get()); > CGPoint aSrcPoint = CGPointMake(-nScaledSourceX, -nScaledSourceY); > if (pSrcShared->isFlipped()) >@@ -508,16 +509,17 @@ bool AquaSalVirtualDevice::SetSize(tools::Long nDX, tools::Long nDY) > > // Allocate buffer for virtual device graphics as bitmap context to store graphics with highest required (scaled) resolution > >- size_t nScaledWidth = mnWidth * fScale; >- size_t nScaledHeight = mnHeight * fScale; >- size_t nBytesPerRow = mnBitmapDepth * nScaledWidth / 8; >- maBitmapContext.set(CGBitmapContextCreate(nullptr, nScaledWidth, nScaledHeight, 8, nBytesPerRow, aColorSpace, nFlags)); >+ // size_t nScaledWidth = mnWidth * fScale; >+ // size_t nScaledHeight = mnHeight * fScale; >+ // size_t nBytesPerRow = mnBitmapDepth * nScaledWidth / 8; >+ maBitmapContext.set(CGBitmapContextCreate(nullptr, 1, 1, 8, mnBitmapDepth / 8, aColorSpace, nFlags)); > > SAL_INFO("vcl.virdev", "AquaSalVirtualDevice::SetSize() this=" << this << > " fScale=" << fScale << " mnBitmapDepth=" << mnBitmapDepth); > >- CGSize aLayerSize = { static_cast<CGFloat>(nScaledWidth), static_cast<CGFloat>(nScaledHeight) }; >- maLayer.set(CGLayerCreateWithContext(maBitmapContext.get(), aLayerSize, nullptr)); >+ // CGSize aLayerSize = { static_cast<CGFloat>(nScaledWidth), static_cast<CGFloat>(nScaledHeight) }; >+ // maLayer.set(CGLayerCreateWithContext(maBitmapContext.get(), aLayerSize, nullptr)); >+ maLayer.set(CGLayerCreateWithContext(maBitmapContext.get(), CGSizeMake(1, 1), nullptr)); > maLayer.setScale(fScale); > mpGraphics->SetVirDevGraphics(this, maLayer, CGLayerGetContext(maLayer.get()), mnBitmapDepth); > >diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx >index 4e0c295a17f4..92cb12de0629 100644 >--- a/vcl/quartz/salvd.cxx >+++ b/vcl/quartz/salvd.cxx >@@ -90,7 +90,8 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( > { > nDY = 1; > } >- maLayer.set(CGLayerCreateWithContext(pData->rCGContext, CGSizeMake(nDX, nDY), nullptr)); >+ // maLayer.set(CGLayerCreateWithContext(pData->rCGContext, CGSizeMake(nDX, nDY), nullptr)); >+ maLayer.set(CGLayerCreateWithContext(pData->rCGContext, CGSizeMake(1, 1), nullptr)); > // Interrogate the context as to its real size > if (maLayer.isSet()) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 159175
:
194758
| 194810