diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2009-06-30 13:02:23 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2009-06-30 13:02:23 +0000 |
commit | aa2684341170424783f9937d8fe441fb3984d825 (patch) | |
tree | b7b1adaf3867666f15d7bf9bacf804846372eff7 /riscos/plotters.c | |
parent | 38356d46ff15fe669c59bdf6aa96b7f4248d1b6a (diff) | |
download | netsurf-aa2684341170424783f9937d8fe441fb3984d825.tar.gz netsurf-aa2684341170424783f9937d8fe441fb3984d825.tar.bz2 |
Improve bitmap plotter API
svn path=/trunk/netsurf/; revision=8195
Diffstat (limited to 'riscos/plotters.c')
-rw-r--r-- | riscos/plotters.c | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/riscos/plotters.c b/riscos/plotters.c index 0cab39041..2ec82b55a 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -53,31 +53,25 @@ static bool ro_plot_disc(int x, int y, int radius, colour colour, bool filled); static bool ro_plot_arc(int x, int y, int radius, int angle1, int angle2, colour c); static bool ro_plot_bitmap(int x, int y, int width, int height, - struct bitmap *bitmap, colour bg, struct content *content); -static bool ro_plot_bitmap_tile(int x, int y, int width, int height, struct bitmap *bitmap, colour bg, - bool repeat_x, bool repeat_y, struct content *content); + bitmap_flags_t flags); struct plotter_table plot; const struct plotter_table ro_plotters = { - ro_plot_clg, - ro_plot_rectangle, - ro_plot_line, - ro_plot_polygon, - ro_plot_fill, - ro_plot_clip, - ro_plot_text, - ro_plot_disc, - ro_plot_arc, - ro_plot_bitmap, - ro_plot_bitmap_tile, - NULL, - NULL, - NULL, - ro_plot_path, - true + .clg = ro_plot_clg, + .rectangle = ro_plot_rectangle, + .line = ro_plot_line, + .polygon = ro_plot_polygon, + .fill = ro_plot_fill, + .clip = ro_plot_clip, + .text = ro_plot_text, + .disc = ro_plot_disc, + .arc = ro_plot_arc, + .bitmap = ro_plot_bitmap, + .path = ro_plot_path, + .option_knockout = true, }; int ro_plot_origin_x = 0; @@ -498,10 +492,15 @@ bool ro_plot_arc(int x, int y, int radius, int angle1, int angle2, colour c) return true; } + + bool ro_plot_bitmap(int x, int y, int width, int height, - struct bitmap *bitmap, colour bg, struct content *content) + struct bitmap *bitmap, colour bg, + bitmap_flags_t flags) { const uint8_t *buffer; + bool repeat_x = (flags & BITMAPF_REPEAT_X); + bool repeat_y = (flags & BITMAPF_REPEAT_Y); buffer = bitmap_get_buffer(bitmap); if (!buffer) { @@ -509,6 +508,7 @@ bool ro_plot_bitmap(int x, int y, int width, int height, return false; } + if (!(repeat_x || repeat_y)) { return image_redraw(bitmap->sprite_area, ro_plot_origin_x + x * 2, ro_plot_origin_y - y * 2, @@ -519,20 +519,7 @@ bool ro_plot_bitmap(int x, int y, int width, int height, false, false, false, bitmap_get_opaque(bitmap) ? IMAGE_PLOT_TINCT_OPAQUE : IMAGE_PLOT_TINCT_ALPHA); -} - - -bool ro_plot_bitmap_tile(int x, int y, int width, int height, - struct bitmap *bitmap, colour bg, - bool repeat_x, bool repeat_y, struct content *content) -{ - const uint8_t *buffer; - - buffer = bitmap_get_buffer(bitmap); - if (!buffer) { - LOG(("bitmap_get_buffer failed")); - return false; - } + } return image_redraw(bitmap->sprite_area, ro_plot_origin_x + x * 2, |