diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-03-23 23:18:05 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-03-23 23:18:05 +0000 |
commit | 281fe7674c04cc9b5216a405a104abb14c9d1778 (patch) | |
tree | e387e70b97b57a172318ab92cb89595653f05cbc | |
parent | 0368935cd31fd08b6383f3941c1f64ecb4c9ef90 (diff) | |
download | netsurf-281fe7674c04cc9b5216a405a104abb14c9d1778.tar.gz netsurf-281fe7674c04cc9b5216a405a104abb14c9d1778.tar.bz2 |
Skip setting the pen in the RastPort if it is already set to that pen
This captures the scenario when the RGBA value has changed but graphics.library has picked the same pen.
-rw-r--r-- | amiga/plotters.c | 8 | ||||
-rw-r--r-- | amiga/plotters.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c index 8d59f8193..9c4f8b068 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -190,6 +190,8 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for gg->apen = 0x00000000; gg->open = 0x00000000; + gg->apen_num = -1; + gg->open_num = -1; init_layers_count++; LOG("Layer initialised (total: %d)", init_layers_count); @@ -275,6 +277,8 @@ void ami_plot_release_pens(struct MinList *shared_pens) glob->apen = 0x00000000; glob->open = 0x00000000; + glob->apen_num = -1; + glob->open_num = -1; } static void ami_plot_setapen(struct RastPort *rp, ULONG colr) @@ -290,7 +294,7 @@ static void ami_plot_setapen(struct RastPort *rp, ULONG colr) #endif { LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr); - if(pen != -1) SetAPen(rp, pen); + if((pen != -1) && (pen != glob->apen_num)) SetAPen(rp, pen); } glob->apen = colr; @@ -309,7 +313,7 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr) #endif { LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr); - if(pen != -1) SetOPen(rp, pen); + if((pen != -1) && (pen != glob->open_num)) SetOPen(rp, pen); } glob->open = colr; diff --git a/amiga/plotters.h b/amiga/plotters.h index c6744740f..7baa21fb5 100644 --- a/amiga/plotters.h +++ b/amiga/plotters.h @@ -36,6 +36,8 @@ struct gui_globals bool palette_mapped; ULONG apen; ULONG open; + LONG apen_num; + LONG open_num; int width; /* size of bm and */ int height; /* associated memory */ }; |