Cairo is a 2D graphics library that supports multiple output devices. Currently supported output targets include X Window System, quartz, Win32, image buffers, postscript, PDF, and SVG.
The following describes the Cairo Plot Model. The first is the most important three concepts in the model: source, mask, and destination. The simple idea is that the source will use the mask filter to draw on our output device (destination.
Source is a drawing board or pen or ink used for drawing. It can be used for drawing and filling. There are four types of Source: colors, gradients, patterns, and images.
The bottom destination is a surface, a device to be output, a window, a PDF, SVG, and so on. So what we need to do is to use the verb to construct a suitable mask.
Mask is used as a filter. The mask is used to determine which parts of the source can be applied to destination and which cannot be used on destination.
All the three layers correspond to a context. Context contains the State data of all graphs (such as the width, color, surface to draw, and others, which allows the plotting function to draw with a few parameters ). The opaque part on the mask layer can be applied to destination, but the transparent part is not.
These "verbs" include stroke and fill. Stroke allows the source near the path to pass through the mask. Fill allows the elements in the path to pass through the mask. (The stroke operation draws the outlines of shapes and the fill operation fills the insides of shapes.) other verbs include painting, mask, and showtext.
For more information, see here: http://www.cairographics.org/tutorial/