From fe7921a387c5a71c8ecba7bb605679b7dab4b86f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 13 Feb 2011 22:25:11 +0000 Subject: Pass clip rect as struct through content_redraw api. Update the front ends to use this. Note only RO build tested. svn path=/trunk/netsurf/; revision=11670 --- image/bmp.c | 6 ++---- image/bmp.h | 7 +++---- image/gif.c | 6 ++---- image/gif.h | 7 +++---- image/ico.c | 6 ++---- image/ico.h | 7 +++---- image/jpeg.c | 6 ++---- image/jpeg.h | 7 +++---- image/mng.c | 6 ++---- image/mng.h | 7 +++---- image/nssprite.c | 3 +-- image/nssprite.h | 4 ++-- image/png.c | 7 +++---- image/png.h | 12 ++++++------ image/rsvg.c | 10 +++++----- image/rsvg.h | 7 +++---- image/svg.c | 3 +-- image/svg.h | 4 ++-- image/webp.c | 3 +-- image/webp.h | 4 ++-- 20 files changed, 51 insertions(+), 71 deletions(-) (limited to 'image') diff --git a/image/bmp.c b/image/bmp.c index ac7bc300e..b5487a3b8 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -117,8 +117,7 @@ bool nsbmp_convert(struct content *c) bool nsbmp_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { @@ -132,8 +131,7 @@ bool nsbmp_redraw(struct content *c, int x, int y, bool nsbmp_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/bmp.h b/image/bmp.h index e78d52f6f..b1d689d2a 100644 --- a/image/bmp.h +++ b/image/bmp.h @@ -34,6 +34,7 @@ struct content; struct bitmap; struct http_parameter; +struct rect; struct content_bmp_data { bmp_image *bmp; /** BMP image data */ @@ -45,12 +46,10 @@ bool nsbmp_create(struct content *c, const struct http_parameter *params); bool nsbmp_convert(struct content *c); void nsbmp_destroy(struct content *c); bool nsbmp_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nsbmp_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool nsbmp_clone(const struct content *old, struct content *new_content); diff --git a/image/gif.c b/image/gif.c index ce2d19a4b..8745942cd 100644 --- a/image/gif.c +++ b/image/gif.c @@ -152,8 +152,7 @@ void nsgif_invalidate(void *bitmap, void *private_word) } bool nsgif_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { if (c->data.gif.current_frame != c->data.gif.gif->decoded_frame) @@ -168,8 +167,7 @@ bool nsgif_redraw(struct content *c, int x, int y, bool nsgif_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/gif.h b/image/gif.h index 9b2eb9fd6..27b2385cf 100644 --- a/image/gif.h +++ b/image/gif.h @@ -32,6 +32,7 @@ struct content; struct http_parameter; +struct rect; struct content_gif_data { struct gif_animation *gif; /**< GIF animation data */ @@ -42,12 +43,10 @@ bool nsgif_create(struct content *c, const struct http_parameter *params); bool nsgif_convert(struct content *c); void nsgif_destroy(struct content *c); bool nsgif_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nsgif_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool nsgif_clone(const struct content *old, struct content *new_content); diff --git a/image/ico.c b/image/ico.c index 190da86d2..e1e3d2939 100644 --- a/image/ico.c +++ b/image/ico.c @@ -105,8 +105,7 @@ bool nsico_convert(struct content *c) } bool nsico_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { struct bmp_image *bmp = ico_find(c->data.ico.ico, width, height); @@ -140,8 +139,7 @@ bool nsico_set_bitmap_from_size(hlcache_handle *h, int width, int height) } bool nsico_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/ico.h b/image/ico.h index 6ed8b59d2..16db54e94 100644 --- a/image/ico.h +++ b/image/ico.h @@ -32,6 +32,7 @@ struct content; struct hlcache_handle; struct http_parameter; +struct rect; struct content_ico_data { struct ico_collection *ico; /** ICO collection data */ @@ -41,12 +42,10 @@ bool nsico_create(struct content *c, const struct http_parameter *params); bool nsico_convert(struct content *c); void nsico_destroy(struct content *c); bool nsico_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nsico_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool nsico_clone(const struct content *old, struct content *new_content); diff --git a/image/jpeg.c b/image/jpeg.c index 6e5e446dd..f247243ea 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -244,8 +244,7 @@ void nsjpeg_term_source(j_decompress_ptr cinfo) */ bool nsjpeg_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { return plot.bitmap(x, y, width, height, @@ -258,8 +257,7 @@ bool nsjpeg_redraw(struct content *c, int x, int y, */ bool nsjpeg_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/jpeg.h b/image/jpeg.h index 5f142546a..c484ec890 100644 --- a/image/jpeg.h +++ b/image/jpeg.h @@ -30,6 +30,7 @@ struct bitmap; struct content; +struct rect; struct content_jpeg_data { int dummy; /* NOT USED but to satisfy Norcroft */ @@ -38,12 +39,10 @@ struct content_jpeg_data { bool nsjpeg_convert(struct content *c); void nsjpeg_destroy(struct content *c); bool nsjpeg_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nsjpeg_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool nsjpeg_clone(const struct content *old, struct content *new_content); diff --git a/image/mng.c b/image/mng.c index c97a96660..d360b4c1a 100644 --- a/image/mng.c +++ b/image/mng.c @@ -524,8 +524,7 @@ void nsmng_destroy(struct content *c) bool nsmng_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { bool ret; @@ -551,8 +550,7 @@ bool nsmng_redraw(struct content *c, int x, int y, bool nsmng_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/mng.h b/image/mng.h index 9b45852a0..eaf92968d 100644 --- a/image/mng.h +++ b/image/mng.h @@ -30,6 +30,7 @@ struct content; struct http_parameter; +struct rect; struct content_mng_data { bool opaque_test_pending; @@ -46,12 +47,10 @@ bool nsmng_process_data(struct content *c, const char *data, unsigned int size); bool nsmng_convert(struct content *c); void nsmng_destroy(struct content *c); bool nsmng_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nsmng_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool nsmng_clone(const struct content *old, struct content *new_content); diff --git a/image/nssprite.c b/image/nssprite.c index 6e2778960..df1cdbe36 100644 --- a/image/nssprite.c +++ b/image/nssprite.c @@ -136,8 +136,7 @@ void nssprite_destroy(struct content *c) */ bool nssprite_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { return plot.bitmap(x, y, width, height, diff --git a/image/nssprite.h b/image/nssprite.h index 7149b1fa0..800defd42 100644 --- a/image/nssprite.h +++ b/image/nssprite.h @@ -29,6 +29,7 @@ #include struct content; +struct rect; struct content_nssprite_data { struct rosprite_area* sprite_area; @@ -37,8 +38,7 @@ struct content_nssprite_data { bool nssprite_convert(struct content *c); void nssprite_destroy(struct content *c); bool nssprite_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool nssprite_clone(const struct content *old, struct content *new_content); diff --git a/image/png.c b/image/png.c index 7be801099..246b6d4ff 100644 --- a/image/png.c +++ b/image/png.c @@ -305,8 +305,7 @@ void nspng_destroy(struct content *c) bool nspng_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { assert(c->bitmap != NULL); @@ -315,8 +314,8 @@ bool nspng_redraw(struct content *c, int x, int y, background_colour, BITMAPF_NONE); } -bool nspng_redraw_tiled(struct content *c, int x, int y, int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, +bool nspng_redraw_tiled(struct content *c, int x, int y, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/png.h b/image/png.h index 9f673d9fe..3e6e157be 100644 --- a/image/png.h +++ b/image/png.h @@ -32,6 +32,7 @@ struct content; struct bitmap; struct http_parameter; +struct rect; struct content_png_data { png_structp png; @@ -47,13 +48,12 @@ bool nspng_process_data(struct content *c, const char *data, unsigned int size); bool nspng_convert(struct content *c); void nspng_destroy(struct content *c); bool nspng_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); -bool nspng_redraw_tiled(struct content *c, int x, int y, int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, - float scale, colour background_colour, - bool repeat_x, bool repeat_y); +bool nspng_redraw_tiled(struct content *c, int x, int y, + int width, int height, struct rect *clip, + float scale, colour background_colour, + bool repeat_x, bool repeat_y); bool nspng_clone(const struct content *old, struct content *new_content); #endif diff --git a/image/rsvg.c b/image/rsvg.c index 6f6babc38..3da101aca 100644 --- a/image/rsvg.c +++ b/image/rsvg.c @@ -180,16 +180,16 @@ bool rsvg_convert(struct content *c) return true; } -bool rsvg_redraw(struct content *c, int x, int y, int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, - float scale, colour background_colour) +bool rsvg_redraw(struct content *c, int x, int y, + int width, int height, struct rect *clip, + float scale, colour background_colour) { plot.bitmap(x, y, width, height, c->bitmap, background_colour, BITMAPF_NONE); return true; } -bool rsvg_redraw_tiled(struct content *c, int x, int y, int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, +bool rsvg_redraw_tiled(struct content *c, int x, int y, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y) { diff --git a/image/rsvg.h b/image/rsvg.h index e85115dcf..78a853c89 100644 --- a/image/rsvg.h +++ b/image/rsvg.h @@ -34,6 +34,7 @@ struct content; struct http_parameter; +struct rect; struct content_rsvg_data { RsvgHandle *rsvgh; /**< Context handle for RSVG renderer */ @@ -47,12 +48,10 @@ bool rsvg_process_data(struct content *c, const char *data, unsigned int size); bool rsvg_convert(struct content *c); void rsvg_destroy(struct content *c); bool rsvg_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool rsvg_redraw_tiled(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour, bool repeat_x, bool repeat_y); bool rsvg_clone(const struct content *old, struct content *new_content); diff --git a/image/svg.c b/image/svg.c index 44f893afe..26112b13c 100644 --- a/image/svg.c +++ b/image/svg.c @@ -107,8 +107,7 @@ void svg_reformat(struct content *c, int width, int height) */ bool svg_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { float transform[6]; diff --git a/image/svg.h b/image/svg.h index 9720a3772..9ce8093e6 100644 --- a/image/svg.h +++ b/image/svg.h @@ -28,6 +28,7 @@ struct content; struct http_parameter; struct svgtiny_diagram; +struct rect; struct content_svg_data { struct svgtiny_diagram *diagram; @@ -39,8 +40,7 @@ bool svg_convert(struct content *c); void svg_destroy(struct content *c); void svg_reformat(struct content *c, int width, int height); bool svg_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool svg_clone(const struct content *old, struct content *new_content); diff --git a/image/webp.c b/image/webp.c index 56d1a5008..671ea5195 100644 --- a/image/webp.c +++ b/image/webp.c @@ -130,8 +130,7 @@ void webp_destroy(struct content *c) */ bool webp_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour) { return plot.bitmap(x, y, width, height, diff --git a/image/webp.h b/image/webp.h index 5ff38c900..acd449cbf 100644 --- a/image/webp.h +++ b/image/webp.h @@ -29,6 +29,7 @@ #include struct content; +struct rect; struct content_webp_data { /* empty */ @@ -37,8 +38,7 @@ struct content_webp_data { bool webp_convert(struct content *c); void webp_destroy(struct content *c); bool webp_redraw(struct content *c, int x, int y, - int width, int height, - int clip_x0, int clip_y0, int clip_x1, int clip_y1, + int width, int height, struct rect *clip, float scale, colour background_colour); bool webp_clone(const struct content *old, struct content *new_content); -- cgit v1.2.3