summaryrefslogtreecommitdiff
path: root/amiga/bitmap.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-25 00:01:55 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-01-25 00:01:55 +0000
commitc0d031bf735559ad1d49ce4d3773ef4788f5a096 (patch)
treeba668180e6705fd6d82782834ae67d1871454a7e /amiga/bitmap.c
parent452d8ce5127f60f0d54a504f6fb9fba1846f058f (diff)
downloadnetsurf-c0d031bf735559ad1d49ce4d3773ef4788f5a096.tar.gz
netsurf-c0d031bf735559ad1d49ce4d3773ef4788f5a096.tar.bz2
Make the palette-mapped state relate to the rendering layer rather than globally.
This means we can still render in 32-bit mode internally when the destination isn't the screen. NB: bitmap_render is currently freezing when the screen is in palette-mapped mode (old bug, pre-dates this change), so for now we skip this routine in that scenario.
Diffstat (limited to 'amiga/bitmap.c')
-rw-r--r--amiga/bitmap.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index ae9479d26..dd6a91b67 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -534,11 +534,7 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
{
- int plot_width;
- int plot_height;
- struct MinList shared_pens;
- struct gui_globals bm_globals;
- struct gui_globals *temp_gg = glob;
+ if(ami_plot_screen_is_palettemapped() == true) return NSERROR_OK;
struct redraw_context ctx = {
.interactive = false,
@@ -546,13 +542,18 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
.plot = &amiplot
};
+ int plot_width;
+ int plot_height;
+ struct gui_globals bm_globals;
+ struct gui_globals *temp_gg = glob;
+// struct MinList *shared_pens = ami_AllocMinList();
+
plot_width = MIN(content_get_width(content), bitmap->width);
plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) /
bitmap->width;
- ami_init_layers(&bm_globals, bitmap->width, bitmap->height);
- ami_NewMinList(&shared_pens);
- bm_globals.shared_pens = &shared_pens;
+ ami_init_layers(&bm_globals, bitmap->width, bitmap->height, true);
+// bm_globals.shared_pens = shared_pens;
glob = &bm_globals;
ami_clearclipreg(&bm_globals);
@@ -582,7 +583,8 @@ static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
to try to avoid re-conversion (at the expense of memory) */
ami_free_layers(&bm_globals);
- ami_plot_release_pens(&shared_pens);
+// ami_plot_release_pens(shared_pens);
+// FreeVec(shared_pens);
amiga_bitmap_set_opaque(bitmap, true);
/* Restore previous render area. This is set when plotting starts,