third_party/cairo/src/cairo-quartz-surface.c
cairo_surface_t *
cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext,
					    unsigned int width,
					    unsigned int height)
{
    cairo_quartz_surface_t *surf;

    surf = _cairo_quartz_surface_create_internal (cgContext, CAIRO_CONTENT_COLOR_ALPHA,
						  width, height);
    if (likely (!surf->base.status))
	CGContextRetain (cgContext);

    return &surf->base;
}
/**
 * cairo_quartz_surface_create_for_cg_context:
 * @cgContext: the existing CGContext for which to create the surface
 * @width: width of the surface, in pixels
 * @height: height of the surface, in pixels
 *
 * Creates a Quartz surface that wraps the given CGContext.  The
 * CGContext is assumed to be in the standard Cairo coordinate space
 * (that is, with the origin at the upper left and the Y axis
 * increasing downward).  If the CGContext is in the Quartz coordinate
 * space (with the origin at the bottom left), then it should be
 * flipped before this function is called.  The flip can be accomplished
 * using a translate and a scale; for example:
 *
 * <informalexample><programlisting>
 * CGContextTranslateCTM (cgContext, 0.0, height);
 * CGContextScaleCTM (cgContext, 1.0, -1.0);
 * </programlisting></informalexample>
 *
 * All Cairo operations are implemented in terms of Quartz operations,
 * as long as Quartz-compatible elements are used (such as Quartz fonts).
 *
 * Return value: the newly created Cairo surface.
 *
 * Since: 1.6
 **/
@cgContext: the existing CGContext for which to create the surface
@width: width of the surface, in pixels
@height: height of the surface, in pixels

Creates a Quartz surface that wraps the given CGContext.  The
CGContext is assumed to be in the standard Cairo coordinate space
(that is, with the origin at the upper left and the Y axis
increasing downward).  If the CGContext is in the Quartz coordinate
space (with the origin at the bottom left), then it should be
flipped before this function is called.  The flip can be accomplished
using a translate and a scale; for example.



All Cairo operations are implemented in terms of Quartz operations,
as long as Quartz-compatible elements are used (such as Quartz fonts).

Return value: the newly created Cairo surface.


@cgContext : the existing CGContext for which to create the surface @width : width of the surface in pixels @height : height of the surface in pixels Creates a Quartz surface that wraps the given CGContext . The CGContext is assumed to be in the standard Cairo coordinate space ( that is with the origin at the upper left and the Y axis increasing downward ) . If the CGContext is in the Quartz coordinate space ( with the origin at the bottom left ) then it should be flipped before this function is called . The flip can be accomplished using a translate and a scale ; for example . All Cairo operations are implemented in terms of Quartz operations as long as Quartz - compatible elements are used ( such as Quartz fonts ) . Return value : the newly created Cairo surface .
cairo_surface_t *
cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext,
					    unsigned int width,
					    unsigned int height)
{
    cairo_quartz_surface_t *surf;
    surf = _cairo_quartz_surface_create_internal (cgContext, CAIRO_CONTENT_COLOR_ALPHA,
						  width, height);
    if (likely (!surf->base.status))
	CGContextRetain (cgContext);
    return &surf->base;
}
cairo_surface_t * cairo_quartz_surface_create_for_cg_context ( CGContextRef cgContext , unsigned int width , unsigned int height ) { cairo_quartz_surface_t * surf ; surf = _cairo_quartz_surface_create_internal ( cgContext , CAIRO_CONTENT_COLOR_ALPHA , width , height ) ; if ( likely ( ! surf -> base . status ) ) CGContextRetain ( cgContext ) ; return & surf -> base ; }
cairo_quartz_surface_create_for_cg_context:
 @cgContext: the existing CGContext for which to create the surface
 @width: width of the surface, in pixels
 @height: height of the surface, in pixels
cairo_quartz_surface_create_for_cg_context : @cgContext : the existing CGContext for which to create the surface @width : width of the surface in pixels @height : height of the surface in pixels