diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-10 19:51:32 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2004-11-10 19:51:32 +0000 |
commit | 542f783b189fe7d2139a1e5e8c37f5b0f264805b (patch) | |
tree | 2109fe3507d48c28b157f67f59a3516423ced2ae | |
parent | 061603094af5ac6cd008a11cb10d30fdc549dd55 (diff) | |
download | netsurf-542f783b189fe7d2139a1e5e8c37f5b0f264805b.tar.gz netsurf-542f783b189fe7d2139a1e5e8c37f5b0f264805b.tar.bz2 |
[project @ 2004-11-10 19:51:31 by rjw]
Further GIF optimisation to reduce flicker.
svn path=/import/netsurf/; revision=1356
-rw-r--r-- | gtk/gtk_bitmap.c | 13 | ||||
-rw-r--r-- | image/bitmap.h | 1 | ||||
-rw-r--r-- | image/gif.c | 7 | ||||
-rw-r--r-- | riscos/bitmap.c | 13 |
4 files changed, 33 insertions, 1 deletions
diff --git a/gtk/gtk_bitmap.c b/gtk/gtk_bitmap.c index 7db84ffe2..ae9fd1695 100644 --- a/gtk/gtk_bitmap.c +++ b/gtk/gtk_bitmap.c @@ -71,6 +71,19 @@ bool bitmap_test_opaque(struct bitmap *bitmap) /**
+ * Gets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ */
+bool bitmap_get_opaque(struct bitmap *bitmap)
+{
+ assert(bitmap);
+/* todo: get whether bitmap is opaque */
+ return false;
+}
+
+
+/**
* Return a pointer to the pixel data in a bitmap.
*
* \param bitmap a bitmap, as returned by bitmap_create()
diff --git a/image/bitmap.h b/image/bitmap.h index 058e03a46..484e64599 100644 --- a/image/bitmap.h +++ b/image/bitmap.h @@ -28,6 +28,7 @@ struct bitmap; struct bitmap *bitmap_create(int width, int height);
void bitmap_set_opaque(struct bitmap *bitmap, bool opaque);
bool bitmap_test_opaque(struct bitmap *bitmap);
+bool bitmap_get_opaque(struct bitmap *bitmap);
char *bitmap_get_buffer(struct bitmap *bitmap);
size_t bitmap_get_rowstride(struct bitmap *bitmap);
void bitmap_destroy(struct bitmap *bitmap);
diff --git a/image/gif.c b/image/gif.c index 697ef408f..8fabf5033 100644 --- a/image/gif.c +++ b/image/gif.c @@ -220,7 +220,12 @@ void nsgif_animate(void *p) data.redraw.full_redraw = c->data.gif.gif->frames[c->data.gif.current_frame - 1].redraw_required; } else { - data.redraw.full_redraw = true; + /* do advanced check */ + data.redraw.full_redraw = !((c->data.gif.current_frame == 0) && + (bitmap_get_opaque(c->data.gif.gif->frame_image)) && + (data.redraw.x == 0) && (data.redraw.y == 0) && + (data.redraw.width = c->data.gif.gif->width) && + (data.redraw.height = c->data.gif.gif->height)); } /* other data */ diff --git a/riscos/bitmap.c b/riscos/bitmap.c index 1fad86ff9..397668e6d 100644 --- a/riscos/bitmap.c +++ b/riscos/bitmap.c @@ -108,6 +108,19 @@ bool bitmap_test_opaque(struct bitmap *bitmap) return true;
}
+
+/**
+ * Gets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ */
+bool bitmap_get_opaque(struct bitmap *bitmap)
+{
+ assert(bitmap);
+ return (bitmap->opaque);
+}
+
+
/**
* Return a pointer to the pixel data in a bitmap.
*
|