static void _gl_destroy (void *device) { cairo_gl_context_t *ctx = device; ctx->acquire (ctx); while (! cairo_list_is_empty (&ctx->fonts)) { cairo_gl_font_t *font; font = cairo_list_first_entry (&ctx->fonts, cairo_gl_font_t, link); cairo_list_del (&font->base.link); cairo_list_del (&font->link); free (font); } _cairo_array_fini (&ctx->tristrip_indices); cairo_region_destroy (ctx->clip_region); _cairo_clip_destroy (ctx->clip); free (ctx->vb); ctx->destroy (ctx); free (ctx); }
static cairo_status_t _cairo_xcb_surface_finish (void *abstract_surface) { cairo_xcb_surface_t *surface = abstract_surface; cairo_status_t status; if (surface->fallback != NULL) { cairo_surface_finish (&surface->fallback->base); cairo_surface_destroy (&surface->fallback->base); } _cairo_boxes_fini (&surface->fallback_damage); cairo_list_del (&surface->link); status = _cairo_xcb_connection_acquire (surface->connection); if (status == CAIRO_STATUS_SUCCESS) { if (surface->picture != XCB_NONE) { _cairo_xcb_connection_render_free_picture (surface->connection, surface->picture); } if (surface->owns_pixmap) _cairo_xcb_connection_free_pixmap (surface->connection, surface->drawable); _cairo_xcb_connection_release (surface->connection); } _cairo_xcb_connection_destroy (surface->connection); return status; }
static void _cairo_gl_node_destroy (cairo_rtree_node_t *node) { cairo_gl_glyph_t *priv = cairo_container_of (node, cairo_gl_glyph_t, node); cairo_scaled_glyph_t *glyph; glyph = priv->glyph; if (glyph == NULL) return; if (glyph->dev_private_key == priv->cache) { glyph->dev_private = NULL; glyph->dev_private_key = NULL; } cairo_list_del (&priv->base.link); priv->glyph = NULL; }
static cairo_status_t _cairo_xcb_surface_finish (void *abstract_surface) { cairo_xcb_surface_t *surface = abstract_surface; cairo_status_t status; if (surface->fallback != NULL) { cairo_surface_finish (surface->fallback); cairo_surface_destroy (surface->fallback); } cairo_list_del (&surface->link); #if CAIRO_HAS_DRM_SURFACE && CAIRO_HAS_XCB_DRM_FUNCTIONS if (surface->drm != NULL) { cairo_surface_finish (surface->drm); cairo_surface_destroy (surface->drm); xcb_dri2_destroy_drawable (surface->connection->xcb_connection, surface->drawable); } #endif status = _cairo_xcb_connection_acquire (surface->connection); if (status == CAIRO_STATUS_SUCCESS) { if (_cairo_xcb_connection_take_socket (surface->connection) == CAIRO_STATUS_SUCCESS) { if (surface->picture != XCB_NONE) { _cairo_xcb_connection_render_free_picture (surface->connection, surface->picture); } if (surface->owns_pixmap) _cairo_xcb_connection_free_pixmap (surface->connection, surface->drawable); } _cairo_xcb_connection_release (surface->connection); } _cairo_xcb_connection_destroy (surface->connection); return status; }