diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-08-12 16:08:50 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-08-23 14:59:25 +0200 |
commit | 09b16f9f44578182306c47cdabe92a31cc5d3b4c (patch) | |
tree | 8dc5af22989d538e119d8d59dc1d87736a71b858 /vcl/osx | |
parent | 13acc8a5df8db5fa24d72c1d44b35e41e4ca2a7c (diff) |
make SalGeometryProvider available for Aqua VCL backends
This is needed for the Skia backend to know the geometry.
The Mac Skia code now passes most VCL unittests.
Change-Id: I6e35764d95ce821d8e11ed9979e5be75bcf6ff49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120806
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salgdiutils.cxx | 3 | ||||
-rw-r--r-- | vcl/osx/salmacos.cxx | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/vcl/osx/salgdiutils.cxx b/vcl/osx/salgdiutils.cxx index 81210c8e876c..da1d3ab2138a 100644 --- a/vcl/osx/salgdiutils.cxx +++ b/vcl/osx/salgdiutils.cxx @@ -75,6 +75,7 @@ void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame ) maShared.mbWindow = true; maShared.mbPrinter = false; maShared.mbVirDev = false; + mpBackend->UpdateGeometryProvider(pFrame); } void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, sal_Int32 nDPIX, sal_Int32 nDPIY ) @@ -97,6 +98,8 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, sal_Int32 nDPIX CGContextSaveGState( maShared.maContextHolder.get() ); maShared.setState(); } + + mpBackend->UpdateGeometryProvider(nullptr); } void AquaSalGraphics::InvalidateContext() diff --git a/vcl/osx/salmacos.cxx b/vcl/osx/salmacos.cxx index 78b06fc911dd..700b252cf4f3 100644 --- a/vcl/osx/salmacos.cxx +++ b/vcl/osx/salmacos.cxx @@ -211,7 +211,7 @@ void AquaGraphicsBackend::copyScaledArea(tools::Long nDstX, tools::Long nDstY,to mrShared.refreshRect(nDstX, nDstY, nSrcWidth, nSrcHeight); } -void AquaSalGraphics::SetVirDevGraphics(CGLayerHolder const &rLayer, CGContextRef xContext, int nBitmapDepth) +void AquaSalGraphics::SetVirDevGraphics(SalVirtualDevice* pVirDev, CGLayerHolder const &rLayer, CGContextRef xContext, int nBitmapDepth) { SAL_INFO("vcl.quartz", "SetVirDevGraphics() this=" << this << " layer=" << rLayer.get() << " context=" << xContext); @@ -224,6 +224,8 @@ void AquaSalGraphics::SetVirDevGraphics(CGLayerHolder const &rLayer, CGContextRe maShared.maLayer = rLayer; maShared.mnBitmapDepth = nBitmapDepth; + mpBackend->UpdateGeometryProvider(pVirDev); + // Get size and scale from layer if set else from bitmap and sal::aqua::getWindowScaling(), which is used to determine // scaling for direct graphics output too @@ -444,7 +446,7 @@ void AquaSalVirtualDevice::Destroy() { if( mpGraphics ) { - mpGraphics->SetVirDevGraphics(nullptr, nullptr); + mpGraphics->SetVirDevGraphics(this, nullptr, nullptr); } CGLayerRelease(maLayer.get()); maLayer.set(nullptr); @@ -517,7 +519,7 @@ bool AquaSalVirtualDevice::SetSize(tools::Long nDX, tools::Long nDY) CGSize aLayerSize = { static_cast<CGFloat>(nScaledWidth), static_cast<CGFloat>(nScaledHeight) }; maLayer.set(CGLayerCreateWithContext(maBitmapContext.get(), aLayerSize, nullptr)); maLayer.setScale(fScale); - mpGraphics->SetVirDevGraphics(maLayer, CGLayerGetContext(maLayer.get()), mnBitmapDepth); + mpGraphics->SetVirDevGraphics(this, maLayer, CGLayerGetContext(maLayer.get()), mnBitmapDepth); SAL_WARN_IF(!maBitmapContext.isSet(), "vcl.quartz", "No context"); |