Package: cairo

CStruct cairo-surface-t

Details

A cairo-surface-t structure 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 structure, create a Cairo context with the surface as the target, using the function cairo-create.

There are different subtypes of a cairo-surface-t structure for different drawing backends. For example, the function cairo-image-surface-create creates a bitmap image in memory. The type of a surface can be queried with the function cairo-surface-type.

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, the functions cairo-image-surface-create and cairo-surface-create-similar. Alternatively, if the user passes in a reference to some backing storage and asks Cairo to wrap that in a cairo-surface-t structure, then the contents are not modified; for example, the function cairo-image-surface-create-for-data.

Memory management of a cairo-surface-t structure is done with the functions cairo-surface-reference and cairo-surface-destroy.
 

See also

2020-12-16