summaryrefslogtreecommitdiff
path: root/src/cairo-quartz-surface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-quartz-surface.c')
-rw-r--r--src/cairo-quartz-surface.c111
1 files changed, 3 insertions, 108 deletions
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 1116ff94c..dbd103d9f 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -86,36 +86,11 @@
* Since: 1.6
**/
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-/* This method is private, but it exists. Its params are are exposed
- * as args to the NS* method, but not as CG.
- */
-enum PrivateCGCompositeMode {
- kPrivateCGCompositeClear = 0,
- kPrivateCGCompositeCopy = 1,
- kPrivateCGCompositeSourceOver = 2,
- kPrivateCGCompositeSourceIn = 3,
- kPrivateCGCompositeSourceOut = 4,
- kPrivateCGCompositeSourceAtop = 5,
- kPrivateCGCompositeDestinationOver = 6,
- kPrivateCGCompositeDestinationIn = 7,
- kPrivateCGCompositeDestinationOut = 8,
- kPrivateCGCompositeDestinationAtop = 9,
- kPrivateCGCompositeXOR = 10,
- kPrivateCGCompositePlusDarker = 11, // (max (0, (1-d) + (1-s)))
- kPrivateCGCompositePlusLighter = 12, // (min (1, s + d))
-};
-typedef enum PrivateCGCompositeMode PrivateCGCompositeMode;
-CG_EXTERN void CGContextSetCompositeOperation (CGContextRef, PrivateCGCompositeMode);
-#endif
-
/* Some of these are present in earlier versions of the OS than where
* they are public; other are not public at all
*/
-/* public since 10.5 */
-static void (*CGContextDrawTiledImagePtr) (CGContextRef, CGRect, CGImageRef) = NULL;
-
/* public since 10.6 */
+/* TODO: check me: documentation states these are available since 10.2 */
static CGPathRef (*CGContextCopyPathPtr) (CGContextRef) = NULL;
static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL;
@@ -146,7 +121,6 @@ static void quartz_ensure_symbols (void)
if (likely (_cairo_quartz_symbol_lookup_done))
return;
- CGContextDrawTiledImagePtr = dlsym (RTLD_DEFAULT, "CGContextDrawTiledImage");
CGContextGetTypePtr = dlsym (RTLD_DEFAULT, "CGContextGetType");
CGContextCopyPathPtr = dlsym (RTLD_DEFAULT, "CGContextCopyPath");
CGContextGetAllowsFontSmoothingPtr = dlsym (RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing");
@@ -363,60 +337,6 @@ _cairo_quartz_cairo_path_to_quartz_context (const cairo_path_fixed_t *path,
/*
* Misc helpers/callbacks
*/
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-static PrivateCGCompositeMode
-_cairo_quartz_cairo_operator_to_quartz_composite (cairo_operator_t op)
-{
- switch (op) {
- case CAIRO_OPERATOR_CLEAR:
- return kPrivateCGCompositeClear;
- case CAIRO_OPERATOR_SOURCE:
- return kPrivateCGCompositeCopy;
- case CAIRO_OPERATOR_OVER:
- return kPrivateCGCompositeSourceOver;
- case CAIRO_OPERATOR_IN:
- return kPrivateCGCompositeSourceIn;
- case CAIRO_OPERATOR_OUT:
- return kPrivateCGCompositeSourceOut;
- case CAIRO_OPERATOR_ATOP:
- return kPrivateCGCompositeSourceAtop;
- case CAIRO_OPERATOR_DEST_OVER:
- return kPrivateCGCompositeDestinationOver;
- case CAIRO_OPERATOR_DEST_IN:
- return kPrivateCGCompositeDestinationIn;
- case CAIRO_OPERATOR_DEST_OUT:
- return kPrivateCGCompositeDestinationOut;
- case CAIRO_OPERATOR_DEST_ATOP:
- return kPrivateCGCompositeDestinationAtop;
- case CAIRO_OPERATOR_XOR:
- return kPrivateCGCompositeXOR;
- case CAIRO_OPERATOR_ADD:
- return kPrivateCGCompositePlusLighter;
-
- case CAIRO_OPERATOR_DEST:
- case CAIRO_OPERATOR_SATURATE:
- case CAIRO_OPERATOR_MULTIPLY:
- case CAIRO_OPERATOR_SCREEN:
- case CAIRO_OPERATOR_OVERLAY:
- case CAIRO_OPERATOR_DARKEN:
- case CAIRO_OPERATOR_LIGHTEN:
- case CAIRO_OPERATOR_COLOR_DODGE:
- case CAIRO_OPERATOR_COLOR_BURN:
- case CAIRO_OPERATOR_HARD_LIGHT:
- case CAIRO_OPERATOR_SOFT_LIGHT:
- case CAIRO_OPERATOR_DIFFERENCE:
- case CAIRO_OPERATOR_EXCLUSION:
- case CAIRO_OPERATOR_HSL_HUE:
- case CAIRO_OPERATOR_HSL_SATURATION:
- case CAIRO_OPERATOR_HSL_COLOR:
- case CAIRO_OPERATOR_HSL_LUMINOSITY:
- default:
- ASSERT_NOT_REACHED;
- }
-}
-#endif
-
static CGBlendMode
_cairo_quartz_cairo_operator_to_quartz_blend (cairo_operator_t op)
{
@@ -452,7 +372,6 @@ _cairo_quartz_cairo_operator_to_quartz_blend (cairo_operator_t op)
case CAIRO_OPERATOR_HSL_LUMINOSITY:
return kCGBlendModeLuminosity;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
case CAIRO_OPERATOR_CLEAR:
return kCGBlendModeClear;
case CAIRO_OPERATOR_SOURCE:
@@ -477,20 +396,6 @@ _cairo_quartz_cairo_operator_to_quartz_blend (cairo_operator_t op)
return kCGBlendModeXOR;
case CAIRO_OPERATOR_ADD:
return kCGBlendModePlusLighter;
-#else
- case CAIRO_OPERATOR_CLEAR:
- case CAIRO_OPERATOR_SOURCE:
- case CAIRO_OPERATOR_OVER:
- case CAIRO_OPERATOR_IN:
- case CAIRO_OPERATOR_OUT:
- case CAIRO_OPERATOR_ATOP:
- case CAIRO_OPERATOR_DEST_OVER:
- case CAIRO_OPERATOR_DEST_IN:
- case CAIRO_OPERATOR_DEST_OUT:
- case CAIRO_OPERATOR_DEST_ATOP:
- case CAIRO_OPERATOR_XOR:
- case CAIRO_OPERATOR_ADD:
-#endif
case CAIRO_OPERATOR_DEST:
case CAIRO_OPERATOR_SATURATE:
@@ -517,16 +422,6 @@ _cairo_cgcontext_set_cairo_operator (CGContextRef context, cairo_operator_t op)
return CAIRO_INT_STATUS_UNSUPPORTED;
}
-#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
- if (op <= CAIRO_OPERATOR_ADD) {
- PrivateCGCompositeMode compmode;
-
- compmode = _cairo_quartz_cairo_operator_to_quartz_composite (op);
- CGContextSetCompositeOperation (context, compmode);
- return CAIRO_STATUS_SUCCESS;
- }
-#endif
-
blendmode = _cairo_quartz_cairo_operator_to_quartz_blend (op);
CGContextSetBlendMode (context, blendmode);
return CAIRO_STATUS_SUCCESS;
@@ -1233,7 +1128,7 @@ _cairo_quartz_setup_state (cairo_quartz_drawing_state_t *state,
}
if (source->type == CAIRO_PATTERN_TYPE_SURFACE &&
- (source->extend == CAIRO_EXTEND_NONE || (CGContextDrawTiledImagePtr && source->extend == CAIRO_EXTEND_REPEAT)))
+ (source->extend == CAIRO_EXTEND_NONE || source->extend == CAIRO_EXTEND_REPEAT))
{
const cairo_surface_pattern_t *spat = (const cairo_surface_pattern_t *) source;
cairo_surface_t *pat_surf = spat->surface;
@@ -1425,7 +1320,7 @@ _cairo_quartz_draw_source (cairo_quartz_drawing_state_t *state,
CGContextEOFillPath (state->cgDrawContext);
}
} else {
- CGContextDrawTiledImagePtr (state->cgDrawContext, state->rect, state->image);
+ CGContextDrawTiledImage (state->cgDrawContext, state->rect, state->image);
}
}