From 79ce683b4e6d34fe327b00f1e427e476016cfab0 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 4 Apr 2010 12:41:19 +0000 Subject: Most of a stop implementation. Remaining work: 1) Clone content_html_data 2) Cloning content_css_data requires the charset of the old content 3) Calling hlcache_handle_abort() before a content has been created must clean up the retrieval context. svn path=/trunk/netsurf/; revision=10236 --- image/bmp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'image/bmp.c') diff --git a/image/bmp.c b/image/bmp.c index 23ea740e9..ac7bc300e 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -162,6 +162,23 @@ void nsbmp_destroy(struct content *c) } + +bool nsbmp_clone(const struct content *old, struct content *new_content) +{ + /* We "clone" the old content by replaying creation and conversion */ + if (nsbmp_create(new_content, NULL) == false) + return false; + + if (old->status == CONTENT_STATUS_READY || + old->status == CONTENT_STATUS_DONE) { + if (nsbmp_convert(new_content) == false) + return false; + } + + return true; +} + + /** * Callback for libnsbmp; forwards the call to bitmap_create() * -- cgit v1.2.3