Bug 1059424 Part 1: Simplify cairo quartz surface generation now that we are minimum macOS 10.9. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 10 Jul 2017 15:17:54 -0700
changeset 607081 e91d105c2de727767c6d78b694bad50a38abf100
parent 607080 ce1c270f930131ee86ed820f694be2907b3d6c80
child 607082 6feabbb4b24740a699938762f8ecd4634cd3a89f
child 607136 b86848cf7ccdc6086154535e063587812e988257
push id67886
push userbwerth@mozilla.com
push dateTue, 11 Jul 2017 20:46:56 +0000
bugs1059424
milestone56.0a1
Bug 1059424 Part 1: Simplify cairo quartz surface generation now that we are minimum macOS 10.9. MozReview-Commit-ID: 7ewjZwbFbwP
gfx/cairo/cairo/src/cairo-quartz-surface.c
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
@@ -135,18 +135,16 @@ static void (*CGContextSetShouldAntialia
 static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL;
 static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL;
 static CGPathRef (*CGContextCopyPathPtr) (CGContextRef) = NULL;
 static CGFloat (*CGContextGetAlphaPtr) (CGContextRef) = NULL;
 
 /* CTFontDrawGlyphs is not available until 10.7 */
 static void (*CTFontDrawGlyphsPtr) (CTFontRef, const CGGlyph[], const CGPoint[], size_t, CGContextRef) = NULL;
 
-static SInt32 _cairo_quartz_osx_version = 0x0;
-
 static cairo_bool_t _cairo_quartz_symbol_lookup_done = FALSE;
 
 /*
  * Utility functions
  */
 
 #ifdef QUARTZ_DEBUG
 static void quartz_surface_to_png (cairo_quartz_surface_t *nq, char *dest);
@@ -174,26 +172,16 @@ static void quartz_ensure_symbols(void)
     CGContextSetShouldAntialiasFontsPtr = dlsym(RTLD_DEFAULT, "CGContextSetShouldAntialiasFonts");
     CGContextCopyPathPtr = dlsym(RTLD_DEFAULT, "CGContextCopyPath");
     CGContextGetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing");
     CGContextSetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing");
     CGContextGetAlphaPtr = dlsym(RTLD_DEFAULT, "CGContextGetAlpha");
 
     CTFontDrawGlyphsPtr = dlsym(RTLD_DEFAULT, "CTFontDrawGlyphs");
 
-#if !TARGET_OS_IPHONE
-    if (Gestalt(gestaltSystemVersion, &_cairo_quartz_osx_version) != noErr) {
-        // assume 10.5
-        _cairo_quartz_osx_version = 0x1050;
-    }
-#else
-    //TODO: this is not great
-    _cairo_quartz_osx_version = 0x1050;
-#endif
-
     _cairo_quartz_symbol_lookup_done = TRUE;
 }
 
 CGImageRef
 _cairo_quartz_create_cgimage (cairo_format_t format,
 			      unsigned int width,
 			      unsigned int height,
 			      unsigned int stride,
@@ -3105,18 +3093,17 @@ static cairo_int_status_t
 	CGContextSetAlpha (surface->cgContext, 1.0);
 
 	return rv;
     }
 
     /* If we have CGContextClipToMask, we can do more complex masks */
     if (CGContextClipToMaskPtr) {
 	/* For these, we can skip creating a temporary surface, since we already have one */
-	/* For some reason this doesn't work reliably on OS X 10.5.  See bug 721663. */
-	if (_cairo_quartz_osx_version >= 0x1060 && mask->type == CAIRO_PATTERN_TYPE_SURFACE &&
+	if (mask->type == CAIRO_PATTERN_TYPE_SURFACE &&
 	    mask->extend == CAIRO_EXTEND_NONE) {
 	    return _cairo_quartz_surface_mask_with_surface (surface, op, source, (cairo_surface_pattern_t *) mask, clip);
 	}
 
 	return _cairo_quartz_surface_mask_with_generic (surface, op, source, mask, clip);
     }
 
     /* So, CGContextClipToMask is not present in 10.3.9, so we're