summaryrefslogtreecommitdiff
path: root/frontends/amiga/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/amiga/bitmap.c')
-rw-r--r--frontends/amiga/bitmap.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index 5fc772ba3..0fde677ae 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -161,7 +161,10 @@ static void amiga_bitmap_unmap_buffer(void *p)
struct bitmap *bm = p;
if((nsoption_bool(use_extmem) == true) && (bm->pixdata != NULL)) {
- LOG("Unmapping ExtMem object %p for bitmap %p", bm->iextmem, bm);
+ NSLOG(netsurf, INFO,
+ "Unmapping ExtMem object %p for bitmap %p",
+ bm->iextmem,
+ bm);
bm->iextmem->Unmap(bm->pixdata, bm->size);
bm->pixdata = NULL;
}
@@ -176,7 +179,10 @@ unsigned char *amiga_bitmap_get_buffer(void *bitmap)
#ifdef __amigaos4__
if(nsoption_bool(use_extmem) == true) {
if(bm->pixdata == NULL) {
- LOG("Mapping ExtMem object %p for bitmap %p", bm->iextmem, bm);
+ NSLOG(netsurf, INFO,
+ "Mapping ExtMem object %p for bitmap %p",
+ bm->iextmem,
+ bm);
bm->pixdata = bm->iextmem->Map(NULL, bm->size, 0LL, 0);
}
@@ -596,8 +602,12 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
TAG_DONE);
if (err != COMPERR_Success) {
- LOG("Composite error %ld - falling back", err);
- /* If it failed, do it again the way which works in software */
+ NSLOG(netsurf, INFO,
+ "Composite error %ld - falling back",
+ err);
+ /* If it failed, do it again the way
+ * which works in software
+ */
#else
{
#endif
@@ -611,7 +621,8 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
COMPTAG_FriendBitMap, scrn->RastPort.BitMap,
TAG_DONE);
/* If it still fails... it's non-fatal */
- LOG("Fallback returned error %ld", err);
+ NSLOG(netsurf, INFO,
+ "Fallback returned error %ld", err);
}
} else /* Do it the old-fashioned way. This is pretty slow, even on OS4.1 */
#endif
@@ -703,11 +714,11 @@ static inline struct BitMap *ami_bitmap_get_palettemapped(struct bitmap *bitmap,
}
struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
- int width, int height, struct BitMap *friendbm)
+ int width, int height, bool palette_mapped, struct BitMap *friendbm)
{
if(bitmap == NULL) return NULL;
- if(__builtin_expect(ami_plot_screen_is_palettemapped() == true, 0)) {
+ if(__builtin_expect(palette_mapped == true, 0)) {
return ami_bitmap_get_palettemapped(bitmap, width, height, friendbm);
} else {
return ami_bitmap_get_truecolour(bitmap, width, height, friendbm);
@@ -723,28 +734,25 @@ void ami_bitmap_fini(void)
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
{
#ifdef __amigaos4__
- LOG("Entering bitmap_render");
-
- struct redraw_context ctx = {
- .interactive = false,
- .background_images = true,
- .plot = &amiplot
- };
+ NSLOG(netsurf, INFO, "Entering bitmap_render");
int plot_width;
int plot_height;
- struct gui_globals bm_globals;
- struct gui_globals *temp_gg = glob;
+ 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;
- ami_init_layers(&bm_globals, bitmap->width, bitmap->height, true);
- bm_globals.shared_pens = NULL;
+ bm_globals = ami_plot_ra_alloc(bitmap->width, bitmap->height, true, false);
+ ami_clearclipreg(bm_globals);
- glob = &bm_globals;
- ami_clearclipreg(&bm_globals);
+ struct redraw_context ctx = {
+ .interactive = false,
+ .background_images = true,
+ .plot = &amiplot,
+ .priv = bm_globals
+ };
content_scaled_redraw(content, plot_width, plot_height, &ctx);
@@ -752,7 +760,7 @@ static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *conte
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,
@@ -766,14 +774,8 @@ 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);
-
- /* Restore previous render area. This is set when plotting starts,
- * but if bitmap_render is called *during* a browser render then
- * having an invalid pointer here causes NetSurf to crash.
- */
- glob = temp_gg;
#else
#warning FIXME for OS3 (in current state none of bitmap_render can work!)
#endif