cairo_surface_t

A #cairo_surface_t represents an image, either as the destination of a drawing operation or as source when drawing onto another surface. To draw to a #cairo_surface_t, create a cairo context with the surface as the target, using cairo.global.create.

There are different subtypes of #cairo_surface_t for different drawing backends; for example, cairo.global.imageSurfaceCreate creates a bitmap image in memory. The type of a surface can be queried with cairo.surface.Surface.getSurfaceType.

The initial contents of a surface after creation depend upon the manner of its creation. If cairo creates the surface and backing storage for the user, it will be initially cleared; for example, cairo.global.imageSurfaceCreate and cairo.surface.Surface.createSimilar. Alternatively, if the user passes in a reference to some backing storage and asks cairo to wrap that in a #cairo_surface_t, then the contents are not modified; for example, cairo.global.imageSurfaceCreateForData and cairo_xlib_surface_create().

Memory management of #cairo_surface_t is done with cairo.surface.Surface.reference and cairo.surface.Surface.destroy.

struct cairo_surface_t