mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-24 07:19:37 +03:00
Convert the rest of plotters.c to use palette-mapped capable colour selection
This commit is contained in:
parent
eed37af751
commit
400d02bc24
@ -293,10 +293,7 @@ bool ami_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetRPAttrs(glob->rp,
|
ami_plot_setapen(style->stroke_colour);
|
||||||
RPTAG_APenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
|
|
||||||
TAG_DONE);
|
|
||||||
Move(glob->rp, x0,y0);
|
Move(glob->rp, x0,y0);
|
||||||
Draw(glob->rp, x1, y0);
|
Draw(glob->rp, x1, y0);
|
||||||
Draw(glob->rp, x1, y1);
|
Draw(glob->rp, x1, y1);
|
||||||
@ -346,7 +343,7 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||||||
LOG(("[ami_plotter] Entered ami_line()"));
|
LOG(("[ami_plotter] Entered ami_line()"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(nsoption_int(cairo_renderer) < 2)
|
if((nsoption_int(cairo_renderer) < 2) || (palette_mapped == true))
|
||||||
{
|
{
|
||||||
glob->rp->PenWidth = style->stroke_width;
|
glob->rp->PenWidth = style->stroke_width;
|
||||||
glob->rp->PenHeight = style->stroke_width;
|
glob->rp->PenHeight = style->stroke_width;
|
||||||
@ -366,10 +363,7 @@ bool ami_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetRPAttrs(glob->rp,
|
ami_plot_setapen(style->stroke_colour);
|
||||||
RPTAG_APenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
|
|
||||||
TAG_DONE);
|
|
||||||
Move(glob->rp,x0,y0);
|
Move(glob->rp,x0,y0);
|
||||||
Draw(glob->rp,x1,y1);
|
Draw(glob->rp,x1,y1);
|
||||||
|
|
||||||
@ -422,17 +416,12 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
|
|||||||
|
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
if(nsoption_int(cairo_renderer) < 1)
|
if((nsoption_int(cairo_renderer) < 1) || (palette_mapped == true))
|
||||||
{
|
{
|
||||||
ULONG cx,cy;
|
ULONG cx,cy;
|
||||||
|
|
||||||
SetRPAttrs(glob->rp,
|
ami_plot_setapen(style->fill_colour);
|
||||||
RPTAG_APenColor,
|
ami_plot_setopen(style->fill_colour);
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
|
|
||||||
RPTAG_OPenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
|
|
||||||
// RPTAG_OPenColor,0xffffffff,
|
|
||||||
TAG_DONE);
|
|
||||||
|
|
||||||
AreaMove(glob->rp,p[0],p[1]);
|
AreaMove(glob->rp,p[0],p[1]);
|
||||||
|
|
||||||
@ -488,7 +477,7 @@ bool ami_clip(const struct rect *clip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NS_AMIGA_CAIRO
|
#ifdef NS_AMIGA_CAIRO
|
||||||
if(nsoption_int(cairo_renderer) == 2)
|
if((nsoption_int(cairo_renderer) == 2) && (palette_mapped == false))
|
||||||
{
|
{
|
||||||
cairo_reset_clip(glob->cr);
|
cairo_reset_clip(glob->cr);
|
||||||
cairo_rectangle(glob->cr, clip->x0, clip->y0,
|
cairo_rectangle(glob->cr, clip->x0, clip->y0,
|
||||||
@ -519,23 +508,16 @@ bool ami_disc(int x, int y, int radius, const plot_style_t *style)
|
|||||||
LOG(("[ami_plotter] Entered ami_disc()"));
|
LOG(("[ami_plotter] Entered ami_disc()"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(nsoption_int(cairo_renderer) < 2)
|
if((nsoption_int(cairo_renderer) < 2) || (palette_mapped == true))
|
||||||
{
|
{
|
||||||
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
if (style->fill_type != PLOT_OP_TYPE_NONE) {
|
||||||
SetRPAttrs(glob->rp,
|
ami_plot_setapen(style->fill_colour);
|
||||||
RPTAG_APenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
|
|
||||||
TAG_DONE);
|
|
||||||
AreaCircle(glob->rp,x,y,radius);
|
AreaCircle(glob->rp,x,y,radius);
|
||||||
AreaEnd(glob->rp);
|
AreaEnd(glob->rp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
|
||||||
SetRPAttrs(glob->rp,
|
ami_plot_setapen(style->stroke_colour);
|
||||||
RPTAG_APenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->stroke_colour),
|
|
||||||
TAG_DONE);
|
|
||||||
|
|
||||||
DrawEllipse(glob->rp,x,y,radius,radius);
|
DrawEllipse(glob->rp,x,y,radius,radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -572,8 +554,12 @@ bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_
|
|||||||
LOG(("[ami_plotter] Entered ami_arc()"));
|
LOG(("[ami_plotter] Entered ami_arc()"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(nsoption_int(cairo_renderer) >= 1)
|
if((nsoption_int(cairo_renderer) == 0) || (palette_mapped == true)) {
|
||||||
{
|
/* TODO: gfx.lib plotter needs arc support */
|
||||||
|
/* eg. http://www.crbond.com/primitives.htm CommonFuncsPPC.lha */
|
||||||
|
ami_plot_setapen(style->fill_colour);
|
||||||
|
/* DrawArc(glob->rp,x,y,(float)angle1,(float)angle2,radius); */
|
||||||
|
} else {
|
||||||
#ifdef NS_AMIGA_CAIRO
|
#ifdef NS_AMIGA_CAIRO
|
||||||
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
ami_cairo_set_colour(glob->cr, style->fill_colour);
|
||||||
ami_cairo_set_solid(glob->cr);
|
ami_cairo_set_solid(glob->cr);
|
||||||
@ -585,19 +571,7 @@ bool ami_arc(int x, int y, int radius, int angle1, int angle2, const plot_style_
|
|||||||
cairo_stroke(glob->cr);
|
cairo_stroke(glob->cr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* TODO: gfx.lib plotter needs arc support */
|
|
||||||
/* http://www.crbond.com/primitives.htm
|
|
||||||
CommonFuncsPPC.lha */
|
|
||||||
|
|
||||||
SetRPAttrs(glob->rp,
|
|
||||||
RPTAG_APenColor,
|
|
||||||
p96EncodeColor(RGBFB_A8B8G8R8, style->fill_colour),
|
|
||||||
TAG_DONE);
|
|
||||||
|
|
||||||
// DrawArc(glob->rp,x,y,(float)angle1,(float)angle2,radius);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,7 +822,7 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width,
|
|||||||
/* We should probably check if the off-screen bitmap is 32-bit and render
|
/* We should probably check if the off-screen bitmap is 32-bit and render
|
||||||
* using Cairo regardless if it is. For now, we respect user preferences.
|
* using Cairo regardless if it is. For now, we respect user preferences.
|
||||||
*/
|
*/
|
||||||
if(nsoption_int(cairo_renderer) >= 1)
|
if((nsoption_int(cairo_renderer) >= 1) && (palette_mapped == false))
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
cairo_matrix_t old_ctm, n_ctm;
|
cairo_matrix_t old_ctm, n_ctm;
|
||||||
|
Loading…
Reference in New Issue
Block a user