Mozilla2:GFXGraphics
From MozillaWiki
Class gfxContext
Your 2d drawing API. To use this you need to first create a surface and call SetSurface().
API
Filters
See gfxContext::PushFilter. This API lets clients not worry about what resolution to create a temporary surface at, etc. It is GFX/Cairo's responsibility to choose a good resolution, based on the current transformation.
The way to implement this is to transform maxArea to device coordinates, take its bounding box, and use that as the area for the temporary surface.