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 --- gtk/thumbnail.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/thumbnail.c b/gtk/thumbnail.c index 53d62fe30..f0a25ce30 100644 --- a/gtk/thumbnail.c +++ b/gtk/thumbnail.c @@ -51,6 +51,7 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, { GdkPixbuf *pixbuf; int cwidth, cheight; + struct rect clip; gint width; gint height; gint depth; @@ -60,6 +61,11 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, assert(content); assert(bitmap); + clip.x0 = 0; + clip.y0 = 0; + clip.x1 = content_get_width(content); + clip.y1 = content_get_width(content); + cwidth = min(content_get_width(content), 1024); cheight = min(content_get_height(content), 768); @@ -100,13 +106,12 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, #endif plot.rectangle(0, 0, cwidth, cwidth, plot_style_fill_white); - plot.clip(0, 0, content_get_width(content), content_get_width(content)); + plot.clip(clip.x0, clip.y0, clip.x1, clip.y1); /* render the content */ content_redraw(content, 0, 0, content_get_width(content), content_get_width(content), - 0, 0, content_get_width(content), - content_get_width(content), 1.0, 0xFFFFFF); + &clip, 1.0, 0xFFFFFF); /* resample the large plot down to the size of our thumbnail */ big = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, 0, 0, 0, 0, -- cgit v1.2.3