mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-20 11:12:46 +03:00
Apparently setting pens is a strangely complex process, so avoid it.
This commit is contained in:
parent
9faef114ec
commit
bd663be927
@ -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));
|
pool_pens = ami_misc_itempool_create(sizeof(struct ami_plot_pen));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gg->apen = 0x00000000;
|
||||||
|
gg->open = 0x00000000;
|
||||||
|
|
||||||
init_layers_count++;
|
init_layers_count++;
|
||||||
LOG("Layer initialised (total: %d)", 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);
|
Remove((struct Node *)node);
|
||||||
ami_misc_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
|
ami_misc_itempool_free(pool_pens, node, sizeof(struct ami_plot_pen));
|
||||||
} while((node = nnode));
|
} while((node = nnode));
|
||||||
|
|
||||||
|
glob->apen = 0x00000000;
|
||||||
|
glob->open = 0x00000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
|
static void ami_plot_setapen(struct RastPort *rp, ULONG colr)
|
||||||
{
|
{
|
||||||
|
if(glob->apen == colr) return;
|
||||||
|
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
if(glob->palette_mapped == false) {
|
if(glob->palette_mapped == false) {
|
||||||
SetRPAttrs(rp, RPTAG_APenColor,
|
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);
|
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||||
if(pen != -1) SetAPen(rp, pen);
|
if(pen != -1) SetAPen(rp, pen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glob->apen = colr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
|
static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
|
||||||
{
|
{
|
||||||
|
if(glob->open == colr) return;
|
||||||
|
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
if(glob->palette_mapped == false) {
|
if(glob->palette_mapped == false) {
|
||||||
SetRPAttrs(rp, RPTAG_OPenColor,
|
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);
|
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||||
if(pen != -1) SetOPen(rp, pen);
|
if(pen != -1) SetOPen(rp, pen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glob->open = colr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
|
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
|
||||||
|
@ -34,6 +34,8 @@ struct gui_globals
|
|||||||
struct Rectangle rect;
|
struct Rectangle rect;
|
||||||
struct MinList *shared_pens;
|
struct MinList *shared_pens;
|
||||||
bool palette_mapped;
|
bool palette_mapped;
|
||||||
|
ULONG apen;
|
||||||
|
ULONG open;
|
||||||
int width; /* size of bm and */
|
int width; /* size of bm and */
|
||||||
int height; /* associated memory */
|
int height; /* associated memory */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user