summaryrefslogtreecommitdiff
path: root/amiga/plotters.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-04 17:46:56 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-08-04 17:46:56 +0100
commit6f647139778b86c00f77fa8b72807e4361530711 (patch)
treef43702285623ebba9f27ccb104399e86e842f251 /amiga/plotters.c
parentfce70264848a04683282da567e429b71b6666847 (diff)
downloadnetsurf-6f647139778b86c00f77fa8b72807e4361530711.tar.gz
netsurf-6f647139778b86c00f77fa8b72807e4361530711.tar.bz2
alloc off-screen bm as friend of screen bm
Diffstat (limited to 'amiga/plotters.c')
-rwxr-xr-xamiga/plotters.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 889d28505..6881de939 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -120,20 +120,38 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
/* init shared bitmaps *
* Height is set to screen width to give enough space for thumbnails *
* Also applies to the further gfx/layers functions and memory below */
+
+ ULONG depth = 32;
struct DrawInfo *dri;
struct BitMap *friend = NULL; /* Required to be NULL for Cairo and ARGB bitmaps */
+ if(dri = GetScreenDrawInfo(scrn)) {
+ if(depth < 16) {
+ palette_mapped = true;
+ depth = dri->dri_Depth; /* this is always wrong */
+ friend = scrn->RastPort.BitMap;
+ } else {
+ palette_mapped = false;
+ }
+ FreeScreenDrawInfo(scrn, dri);
+ }
+
if(nsoption_int(redraw_tile_size_x) <= 0) nsoption_set_int(redraw_tile_size_x, scrn->Width);
if(nsoption_int(redraw_tile_size_y) <= 0) nsoption_set_int(redraw_tile_size_y, scrn->Height);
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
gg->layerinfo = NewLayerInfo();
- gg->areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR);
- gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR);
+ gg->areabuf = AllocVec(100, MEMF_PRIVATE | MEMF_CLEAR);
+ gg->tmprasbuf = AllocVec(width * height, MEMF_PRIVATE | MEMF_CLEAR);
- gg->bm = p96AllocBitMap(width, height, 32,
+ if(palette_mapped ==false) {
+ gg->bm = p96AllocBitMap(width, height, 32,
BMF_INTERLEAVED, friend, RGBFB_A8R8G8B8);
+ } else {
+ gg->bm = AllocBitMap(width, height, depth, BMF_INTERLEAVED, friend);
+ }
+
if(!gg->bm) warn_user("NoMemory","");
gg->rp = AllocVec(sizeof(struct RastPort), MEMF_PRIVATE | MEMF_CLEAR);
@@ -165,15 +183,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->surface = cairo_amigaos_surface_create(gg->rp->BitMap);
gg->cr = cairo_create(gg->surface);
#endif
-
- if(dri = GetScreenDrawInfo(scrn)) {
- if(dri->dri_Depth < 16) { /* this is always true */
- palette_mapped = true;
- } else {
- palette_mapped = false;
- }
- FreeScreenDrawInfo(scrn,dri);
- }
}
void ami_free_layers(struct gui_globals *gg)