From 3d9a1198db571973e2760d6f27c771cbe31c844b Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Wed, 22 Feb 2006 01:58:19 +0000 Subject: [project @ 2006-02-22 01:58:19 by rjw] Reduce constant bitmap overhead per reference by moving to a flag word. Allow bitmaps to be reduced back to their raw data to free extra memory in a highly efficient manner. svn path=/import/netsurf/; revision=2089 --- gtk/gtk_bitmap.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/gtk_bitmap.c b/gtk/gtk_bitmap.c index 26b6b5a37..58fff8280 100644 --- a/gtk/gtk_bitmap.c +++ b/gtk/gtk_bitmap.c @@ -29,11 +29,11 @@ struct bitmap; * * \param width width of image in pixels * \param height width of image in pixels - * \param clear whether to clear the image ready for use + * \param state a flag word indicating the initial state * \return an opaque struct bitmap, or NULL on memory exhaustion */ -struct bitmap *bitmap_create(int width, int height, bitmap_state state) +struct bitmap *bitmap_create(int width, int height, unsigned int state) { GdkPixbuf *pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width, height); @@ -146,3 +146,16 @@ bool bitmap_save(struct bitmap *bitmap, const char *path) */ void bitmap_modified(struct bitmap *bitmap) { } + + +/** + * The bitmap image can be suspended. + * + * \param bitmap a bitmap, as returned by bitmap_create() + * \param private_word a private word to be returned later + * \param suspend the function to be called upon suspension + * \param resume the function to be called when resuming + */ +void bitmap_set_suspendable(struct bitmap *bitmap, void *private_word, + void (*invalidate)(struct bitmap *bitmap, void *private_word)) { +} -- cgit v1.2.3