package cairo2

  1. Overview
  2. Docs

The recording surface is a surface that records all drawing operations at the highest level of the surface backend interface. The surface can then be "replayed" against any target surface by using it as a source surface.

A recording surface is logically unbounded, i.e. it has no implicit constraint on the size of the drawing surface.

val create : ?extents:rectangle -> content -> Surface.t

Creates a recording surface with the specified content. It can record all drawing operations at the highest level (that is, the level of paint, mask, stroke, fill and Glyph.show_text). The surface is unbounded (no constraints on the size of the drawing surface) unless the extents argument is provided. Copying to another surface (see set_source_surface) will be more efficient (and sometime required) if the extents are specified when the recording surface is created.

val ink_extents : Surface.t -> rectangle

Measures the extents of the operations stored within the recording surface. This is useful to compute the required size of another drawing surface into which to replay the full sequence of drawing operations.

OCaml

Innovation. Community. Security.