Remove cairo_quartz_{get,finish}_cg_context_with_clip. draft
authorJonathan Kew <jkew@mozilla.com>
Sun, 18 Apr 2021 19:11:00 +0100
changeset 3667283 913280783486ed96b222facd25a66a1ee78b144a
parent 3667282 aa842acb886c7e8d07a71699fffa80579bb8951e
child 3667284 bcf5be0b5e9b25531b53cc6353bc07bbe9704a0d
push id683063
push userjkew@mozilla.com
push dateMon, 19 Apr 2021 13:15:26 +0000
treeherdertry@919daaf50d14 [default view] [failures only]
milestone89.0a1
Remove cairo_quartz_{get,finish}_cg_context_with_clip. No longer needed in Gecko.
gfx/cairo/cairo/src/cairo-quartz-surface.c
gfx/cairo/cairo/src/cairo-quartz.h
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
@@ -3497,72 +3497,16 @@ cairo_quartz_surface_get_cg_context (cai
 }
 
 static cairo_bool_t
 _cairo_surface_is_quartz (const cairo_surface_t *surface)
 {
     return surface->backend == &cairo_quartz_surface_backend;
 }
 
-CGContextRef
-cairo_quartz_get_cg_context_with_clip (cairo_t *cr)
-{
-
-    cairo_surface_t *surface = cr->gstate->target;
-    cairo_clip_t *clip = &cr->gstate->clip;
-    cairo_status_t status;
-
-    cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface;
-
-    if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ)
-	return NULL;
-
-    if (!clip->path) {
-	if (clip->all_clipped) {
-	    /* Save the state before we set an empty clip rect so that
-	     * our previous clip will be restored */
-
-	    /* _cairo_surface_clipper_set_clip doesn't deal with
-	     * clip->all_clipped because drawing is normally discarded earlier */
-	    CGRect empty = {{0,0}, {0,0}};
-	    CGContextClipToRect (quartz->cgContext, empty);
-	    CGContextSaveGState (quartz->cgContext);
-
-	    return quartz->cgContext;
-	}
-
-	/* an empty clip is represented by NULL */
-	clip = NULL;
-    }
-
-    status = _cairo_surface_clipper_set_clip (&quartz->clipper, clip);
-
-    /* Save the state after we set the clip so that it persists
-     * after we restore */
-    CGContextSaveGState (quartz->cgContext);
-
-    if (unlikely (status))
-	return NULL;
-
-    return quartz->cgContext;
-}
-
-void
-cairo_quartz_finish_cg_context_with_clip (cairo_t *cr)
-{
-    cairo_surface_t *surface = cr->gstate->target;
-
-    cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface;
-
-    if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ)
-	return;
-
-    CGContextRestoreGState (quartz->cgContext);
-}
-
 cairo_surface_t *
 cairo_quartz_surface_get_image (cairo_surface_t *surface)
 {
     cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t *)surface;
     cairo_image_surface_t *image;
 
     if (_cairo_quartz_get_image(quartz, &image))
         return NULL;
--- a/gfx/cairo/cairo/src/cairo-quartz.h
+++ b/gfx/cairo/cairo/src/cairo-quartz.h
@@ -65,22 +65,16 @@ cairo_quartz_surface_create_for_data (un
 cairo_public cairo_surface_t *
 cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext,
                                             unsigned int width,
                                             unsigned int height);
 
 cairo_public CGContextRef
 cairo_quartz_surface_get_cg_context (cairo_surface_t *surface);
 
-cairo_public CGContextRef
-cairo_quartz_get_cg_context_with_clip (cairo_t *cr);
-
-cairo_public void
-cairo_quartz_finish_cg_context_with_clip (cairo_t *cr);
-
 cairo_public cairo_surface_t *
 cairo_quartz_surface_get_image (cairo_surface_t *surface);
 
 #if CAIRO_HAS_QUARTZ_FONT
 
 /*
  * Quartz font support
  */