From 8c7eea4b620701b105b4206da9b2c2dbf89fb717 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 28 Apr 2013 12:21:39 +0100 Subject: [PATCH] Allocate the off-screen BitMap as a friend of the screen BitMap in the increasingly diminishing number of cases where this works correctly. This should stop NetSurf using memory on the wrong graphics card when two are installed. --- amiga/plotters.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/amiga/plotters.c b/amiga/plotters.c index ace3c3b53..884b1ce78 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -156,14 +156,21 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) ULONG depth = 32; struct DrawInfo *dri; - struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB bitmaps */ + struct BitMap *friend = NULL; depth = GetBitMapAttr(scrn->RastPort.BitMap, BMA_DEPTH); if((depth < 16) || (nsoption_int(cairo_renderer) == -1)) { palette_mapped = true; - // friend = scrn->RastPort.BitMap; } else { palette_mapped = false; + + /* If we're not palette-mapping allocate using a friend BitMap if the + * depth is 32bpp. In all other cases using a friend BitMap causes a + * hard lockup or odd/missing graphical effects. + */ + + if(depth == 32) + friend = scrn->RastPort.BitMap; } if(nsoption_int(redraw_tile_size_x) <= 0) nsoption_set_int(redraw_tile_size_x, scrn->Width);