mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-03 22:58:19 +02:00
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:
parent
c5fc8fa62f
commit
f156f89db0
1 changed files with 2 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue