[mailto:netsurf-dev-bounces@netsurf-browser.org] On Behalf Of
John-Mark Bell
On Mon, 2009-06-29 at 10:21 +0100, Richard Wilson wrote:
<snip>
> 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)
> I'd 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);
I wonder if the orientation can be sorted out in the core.
Thus bitmaps presented to the plotters are always oriented correctly.
The specification states (
http://www.w3.org/TR/css3-page/#orienting,
section 7) "In terms of the order of transformations, the image is first
rotated, then sized, then positioned." If I've interpretted this correctly
it means that if you had a 45 degree rotated background image of Soulja Boy
tiled across your MySpace page, it would show the background through:
/\../\../\ < rotate, plot /\**/\**/\
**\/**\/** probably correct **\/**\/**
**/\**/\** **/\**/\**
\/..\/..\/ plot rotated > \/**\/**\
/\../\../\ more Soulja Boy /\**/\**/\
**\/**\/** but wrong **\/**\/**
This means that it really doesn't matter where you do the rotation as the
plotters don't need the additional pattern-repeat information. My desire
would be to have everthing ordered along the lines of:
1) Plotters get passed rotation
2) If plotter can hand rotation, plot rotated natively
3) If plotter can't handle rotation directly, call bitmap_rotate to get a
(cached?) rotated bitmap back which can then be plotted natively
This gives us the best of both worlds (I'm unlikely to ever implement
rotated plotting in Tinct, but would possibly implement Tinct_Rotate to go
in bitmap_rotate to quickly generate the rotated images.)
R.
--
Richard Wilson