diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-12-11 20:12:18 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-12-11 20:34:28 +0200 |
commit | 311490855235a85bceb05e6009d3c37f79b3bc2a (patch) | |
tree | 0836015062f4b3b225e5248fbac2d2297cf0c176 /vcl/quartz/salgdiutils.cxx | |
parent | e760ee23a41e7ca64b8a38866d3eb231ad854ec1 (diff) |
Do as the docs say: Use the CGContext property instead of graphicsPort
The graphicsPort property of NSGraphicsContext is deprecated in 10.14.
CGContext is there since 10.10 so we can use it unconditionally.
But sadly this did not enable me to un-comment the assert() a few
lines below.
Wonder if this deprecation is just a cleanup of the API, and
functionality-wise the CGContext property is exactly the same as
graphicsPort?
Change-Id: I2d5d0c766c343faa2d8cabea3a0729ce5b3a34e3
Diffstat (limited to 'vcl/quartz/salgdiutils.cxx')
-rw-r--r-- | vcl/quartz/salgdiutils.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx index 2218d3e936a4..30c5755d1efd 100644 --- a/vcl/quartz/salgdiutils.cxx +++ b/vcl/quartz/salgdiutils.cxx @@ -124,9 +124,7 @@ bool AquaSalGraphics::CheckContext() { const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) }; NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()]; -SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first deprecated in macOS 10.14 - CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]); -SAL_WNODEPRECATED_DECLARATIONS_POP + CGContextRef xCGContext = [pNSGContext CGContext]; mxLayer = CGLayerCreateWithContext(xCGContext, aLayerSize, nullptr); SAL_INFO("vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer); if (mxLayer) @@ -208,10 +206,8 @@ void AquaSalGraphics::UpdateWindow( NSRect& ) NSGraphicsContext* pContext = [NSGraphicsContext currentContext]; if( (mxLayer != nullptr) && (pContext != nullptr) ) { -SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'graphicsPort' is deprecated: first deprecated in macOS 10.14 - CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]); -SAL_WNODEPRECATED_DECLARATIONS_POP - SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext ); + CGContextRef rCGContext = [pContext CGContext]; + SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] CGContext] = " << rCGContext ); CGMutablePathRef rClip = mpFrame->getClipPath(); if( rClip ) |