Skip to content
Permalink
Browse files

Fix build error with macOS 10.13 SDK

Several of these variables/macros are no longer defined. We didn't
validate the preconditions on iOS, tvOS, or watchOS, so no
need to bother validating them on macOS either. Nor did we check the
OSStatus result on any platform anyways.

Task-number: QTBUG-62266
Change-Id: Id19ebead5d3a8a08a0a56d798f0173d0d893fc91
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
  • Loading branch information...
jakepetroules authored and Jędrzej Nowacki committed Aug 2, 2017
1 parent 569171f commit 861544583511d4e6f7745d2339b26ff1cd44132b
Showing with 2 additions and 18 deletions.
  1. +1 −17 src/gui/painting/qcoregraphics.mm
  2. +1 −1 src/gui/painting/qcoregraphics_p.h
@@ -72,31 +72,15 @@ CGImageRef qt_mac_toCGImageMask(const QImage &image)
image.bytesPerLine(), dataProvider, NULL, false);
}

OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
{
// Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
OSStatus err = noErr;

#ifdef Q_OS_MACOS
require_action(inContext != NULL, InvalidContext, err = paramErr);
require_action(inBounds != NULL, InvalidBounds, err = paramErr);
require_action(inImage != NULL, InvalidImage, err = paramErr);
#endif

CGContextSaveGState( inContext );
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
CGContextScaleCTM(inContext, 1, -1);

CGContextDrawImage(inContext, *inBounds, inImage);

CGContextRestoreGState(inContext);

#ifdef Q_OS_MACOS
InvalidImage:
InvalidBounds:
InvalidContext:
#endif
return err;
}

QImage qt_mac_toQImage(CGImageRef image)
@@ -71,7 +71,7 @@ Q_GUI_EXPORT CGImageRef qt_mac_toCGImage(const QImage &qImage);
Q_GUI_EXPORT CGImageRef qt_mac_toCGImageMask(const QImage &qImage);
Q_GUI_EXPORT QImage qt_mac_toQImage(CGImageRef image);

Q_GUI_EXPORT OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
Q_GUI_EXPORT void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);

Q_GUI_EXPORT CGColorSpaceRef qt_mac_genericColorSpace();
Q_GUI_EXPORT CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice);

0 comments on commit 8615445

Please sign in to comment.
You can’t perform that action at this time.