Skip to content

Instantly share code, notes, and snippets.

@mnutt
Created November 22, 2017 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnutt/593f2252d6c68601cb0fc6efe6f4a88b to your computer and use it in GitHub Desktop.
Save mnutt/593f2252d6c68601cb0fc6efe6f4a88b to your computer and use it in GitHub Desktop.
diff --git a/qtbase/src/gui/painting/qcoregraphics.mm b/qtbase/src/gui/painting/qcoregraphics.mm
index 98fdd7f35e..c4fb8afc64 100644
--- a/qtbase/src/gui/painting/qcoregraphics.mm
+++ b/qtbase/src/gui/painting/qcoregraphics.mm
@@ -72,17 +72,8 @@ 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);
@@ -90,13 +81,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
CGContextDrawImage(inContext, *inBounds, inImage);
CGContextRestoreGState(inContext);
-
-#ifdef Q_OS_MACOS
-InvalidImage:
-InvalidBounds:
-InvalidContext:
-#endif
- return err;
}
QImage qt_mac_toQImage(CGImageRef image)
diff --git a/qtbase/src/gui/painting/qcoregraphics_p.h b/qtbase/src/gui/painting/qcoregraphics_p.h
index 54de3f332e..d74c4d0711 100644
--- a/qtbase/src/gui/painting/qcoregraphics_p.h
+++ b/qtbase/src/gui/painting/qcoregraphics_p.h
@@ -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);
--
2.14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment