quartz: Simplify cairo_quartz_surface_create_for_cg_context

Only retaining the context when the surface cration is successful
avoids needless retaining and simplifies the code.
This commit is contained in:
Andrea Canciani 2010-07-27 18:55:38 +02:00
parent c5fc8fa62f
commit f156f89db0

View file

@ -3029,15 +3029,10 @@ cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext,
{
cairo_quartz_surface_t *surf;
CGContextRetain (cgContext);
surf = _cairo_quartz_surface_create_internal (cgContext, CAIRO_CONTENT_COLOR_ALPHA,
width, height);
if (surf->base.status) {
CGContextRelease (cgContext);
// create_internal will have set an error
return &surf->base;
}
if (likely (!surf->base.status))
CGContextRetain (cgContext);
return &surf->base;
}