[mailto:email@example.com] On Behalf Of
The existing plotter API has been slowly extended as NetSurf
has evolved, and it's a bit inconsistent.
John-Mark has put a proposal for improving it up here:
This all looks nicer to me, although I'd like to extend the API slightly to
simplify more complex plotters. The first change I'd like to forward is
bool (*initialise)(void *pw); /** <optional, may be NULL */
bool (*finalise)(void *pw); /** <optional, may be NULL */
These would be called upon the plotters being changed, and would allow for
any memory required by the plotters (knockout renderer's buffers etc) or
caching (LUTs for font matching?) to be cleanly handled.
The second change is to extend the bitmap API slightly to support the CSS3
image-orientation tag (http://www.w3.org/TR/css3-page/#orienting
suggest that the simplest manner to support this is to just add an extra
parameter to both bitmap and bitmap_tile.
bool (*bitmap)(void *pw, const plot_rect *rect, struct bitmap *bitmap,
colour_t bg_colour, float orientation);
bool (*bitmap_tile)(void *pw, const plot_rect *rect, struct bitmap *bitmap,
colour_t bg_colour, float orientation, bool repeat_x, bool repeat_y);
Regarding the merging of these two functions -- I'm in two minds. On the
positive side, it would give simpler code paths to follow, but on the
negative, it would add a bunch of pointless parameters to all non-background
image code. I'd possibly like to merge repeat_x and repeat_y into a flag