diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-02-13 17:46:20 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-02-13 17:46:20 +0000 |
commit | 075e9c0258bd75307a90b3e6bd576742bf212b08 (patch) | |
tree | d915cc2b8788b585e8123e9715ff623eed0f1717 /frontends/amiga/bitmap.c | |
parent | edaa9c29f22a550ddc7c8e1f02ff6d9dedf9a5b1 (diff) | |
download | netsurf-075e9c0258bd75307a90b3e6bd576742bf212b08.tar.gz netsurf-075e9c0258bd75307a90b3e6bd576742bf212b08.tar.bz2 |
Alloc gui_global structure when initialising
Diffstat (limited to 'frontends/amiga/bitmap.c')
-rw-r--r-- | frontends/amiga/bitmap.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index 95e99aa5b..31448d6cc 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -727,29 +727,29 @@ static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *conte int plot_width; int plot_height; - struct gui_globals bm_globals; + struct gui_globals *bm_globals; + + plot_width = MIN(content_get_width(content), bitmap->width); + plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) / + bitmap->width; + + bm_globals = ami_plot_ra_alloc(bitmap->width, bitmap->height, true); + ami_clearclipreg(bm_globals); struct redraw_context ctx = { .interactive = false, .background_images = true, .plot = &amiplot, - .priv = &bm_globals + .priv = bm_globals }; - 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, true); - ami_clearclipreg(&bm_globals); - content_scaled_redraw(content, plot_width, plot_height, &ctx); BltBitMapTags( BLITA_SrcX, 0, BLITA_SrcY, 0, BLITA_Width, bitmap->width, BLITA_Height, bitmap->height, - BLITA_Source, bm_globals.bm, + BLITA_Source, ami_plot_ra_get_bitmap(bm_globals), BLITA_SrcType, BLITT_BITMAP, BLITA_Dest, amiga_bitmap_get_buffer(bitmap), BLITA_DestType, BLITT_ARGB32, @@ -763,7 +763,7 @@ static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *conte /**\todo In theory we should be able to move the bitmap to our native area to try to avoid re-conversion (at the expense of memory) */ - ami_free_layers(&bm_globals); + ami_plot_ra_free(bm_globals); amiga_bitmap_set_opaque(bitmap, true); #else #warning FIXME for OS3 (in current state none of bitmap_render can work!) |