summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-03-22 18:45:20 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-03-22 18:45:20 +0000
commitbd663be92766de17e5dbef62ae98ca0cbb26cc7c (patch)
tree7fdfb5f9fc6d4c55888d59d8164981c772e45906 /amiga
parent9faef114ec589182d941c1b563887c4950e22730 (diff)
downloadnetsurf-bd663be92766de17e5dbef62ae98ca0cbb26cc7c.tar.gz
netsurf-bd663be92766de17e5dbef62ae98ca0cbb26cc7c.tar.bz2
Apparently setting pens is a strangely complex process, so avoid it.
Diffstat (limited to 'amiga')
-rw-r--r--amiga/plotters.c14
-rw-r--r--amiga/plotters.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 0a0057cb4..e9293086f 100644
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -188,6 +188,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
pool_pens = ami_misc_itempool_create(sizeof(struct ami_plot_pen));
}
+ gg->apen = 0x00000000;
+ gg->open = 0x00000000;
+
init_layers_count++;
LOG("Layer initialised (total: %d)", init_layers_count);
}
@@ -269,10 +272,15 @@ void ami_plot_release_pens(struct MinList *shared_pens)
Remove((struct Node *)node);
ami_misc_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
} while((node = nnode));
+
+ glob->apen = 0x00000000;
+ glob->open = 0x00000000;
}
static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
{
+ if(glob->apen == colr) return;
+
#ifdef __amigaos4__
if(glob->palette_mapped == false) {
SetRPAttrs(rp, RPTAG_APenColor,
@@ -284,10 +292,14 @@ static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetAPen(rp, pen);
}
+
+ glob->apen = colr;
}
static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
{
+ if(glob->open == colr) return;
+
#ifdef __amigaos4__
if(glob->palette_mapped == false) {
SetRPAttrs(rp, RPTAG_OPenColor,
@@ -299,6 +311,8 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetOPen(rp, pen);
}
+
+ glob->open = colr;
}
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
diff --git a/amiga/plotters.h b/amiga/plotters.h
index 841700e4a..c6744740f 100644
--- a/amiga/plotters.h
+++ b/amiga/plotters.h
@@ -34,6 +34,8 @@ struct gui_globals
struct Rectangle rect;
struct MinList *shared_pens;
bool palette_mapped;
+ ULONG apen;
+ ULONG open;
int width; /* size of bm and */
int height; /* associated memory */
};