summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-07-05 20:10:17 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-07-05 20:10:17 +0000
commit0ade453958339a28b4291aefd6fd0bd2e5038afd (patch)
tree5a6be53fef4f3790f5902d8ac574c6ef725b29bb /riscos
parentab2391ade1592936b95b106d17a77ff09ba852a8 (diff)
downloadnetsurf-0ade453958339a28b4291aefd6fd0bd2e5038afd.tar.gz
netsurf-0ade453958339a28b4291aefd6fd0bd2e5038afd.tar.bz2
Refactor fill plotter to take a style
svn path=/trunk/netsurf/; revision=8332
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui/progress_bar.c5
-rw-r--r--riscos/plotters.c9
-rw-r--r--riscos/print.c4
-rw-r--r--riscos/save_draw.c13
-rw-r--r--riscos/window.c2
5 files changed, 18 insertions, 15 deletions
diff --git a/riscos/gui/progress_bar.c b/riscos/gui/progress_bar.c
index 129b65523..f1f214b01 100644
--- a/riscos/gui/progress_bar.c
+++ b/riscos/gui/progress_bar.c
@@ -509,8 +509,9 @@ void ro_gui_progress_bar_redraw_window(wimp_draw *redraw,
progress_ymid - progress_height,
tinct_FILL_HORIZONTALLY);
} else {
- plot.fill(clip_x0, clip_y0, clip_x1, clip_y1,
- 0x000000ff);
+ plot.fill(clip_x0, clip_y0,
+ clip_x1, clip_y1,
+ plot_style_fill_red);
}
}
}
diff --git a/riscos/plotters.c b/riscos/plotters.c
index 8ff46ad0a..5422d3211 100644
--- a/riscos/plotters.c
+++ b/riscos/plotters.c
@@ -43,7 +43,7 @@ static bool ro_plot_draw_path(const draw_path * const path, int width,
static bool ro_plot_polygon(const int *p, unsigned int n, colour fill);
static bool ro_plot_path(const float *p, unsigned int n, colour fill, float width,
colour c, const float transform[6]);
-static bool ro_plot_fill(int x0, int y0, int x1, int y1, colour c);
+static bool ro_plot_fill(int x0, int y0, int x1, int y1, plot_style_t *style);
static bool ro_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
static bool ro_plot_text(int x, int y, const struct css_style *style,
@@ -303,12 +303,13 @@ error:
}
-bool ro_plot_fill(int x0, int y0, int x1, int y1, colour c)
+bool ro_plot_fill(int x0, int y0, int x1, int y1, plot_style_t *style)
{
os_error *error;
- error = xcolourtrans_set_gcol(c << 8, colourtrans_USE_ECFS_GCOL,
- os_ACTION_OVERWRITE, 0, 0);
+ error = xcolourtrans_set_gcol(style->fill_colour << 8,
+ colourtrans_USE_ECFS_GCOL,
+ os_ACTION_OVERWRITE, 0, 0);
if (error) {
LOG(("xcolourtrans_set_gcol: 0x%x: %s",
error->errnum, error->errmess));
diff --git a/riscos/print.c b/riscos/print.c
index 8742f40b6..a216bbee4 100644
--- a/riscos/print.c
+++ b/riscos/print.c
@@ -102,7 +102,7 @@ static bool print_fonts_plot_rectangle(int x0, int y0, int width, int height,
static bool print_fonts_plot_line(int x0, int y0, int x1, int y1, int width,
colour c, bool dotted, bool dashed);
static bool print_fonts_plot_polygon(const int *p, unsigned int n, colour fill);
-static bool print_fonts_plot_fill(int x0, int y0, int x1, int y1, colour c);
+static bool print_fonts_plot_fill(int x0, int y0, int x1, int y1, plot_style_t *style);
static bool print_fonts_plot_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
static bool print_fonts_plot_text(int x, int y, const struct css_style *style,
@@ -824,7 +824,7 @@ bool print_fonts_plot_polygon(const int *p, unsigned int n, colour fill)
return true;
}
-bool print_fonts_plot_fill(int x0, int y0, int x1, int y1, colour c)
+bool print_fonts_plot_fill(int x0, int y0, int x1, int y1, plot_style_t *style)
{
return true;
}
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index 320f7bfb9..f74608cf3 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -44,7 +44,7 @@ static bool ro_save_draw_line(int x0, int y0, int x1, int y1, int width,
static bool ro_save_draw_polygon(const int *p, unsigned int n, colour fill);
static bool ro_save_draw_path(const float *p, unsigned int n, colour fill,
float width, colour c, const float transform[6]);
-static bool ro_save_draw_fill(int x0, int y0, int x1, int y1, colour c);
+static bool ro_save_draw_fill(int x0, int y0, int x1, int y1, plot_style_t *style);
static bool ro_save_draw_clip(int clip_x0, int clip_y0,
int clip_x1, int clip_y1);
static bool ro_save_draw_text(int x, int y, const struct css_style *style,
@@ -302,7 +302,7 @@ bool ro_save_draw_path(const float *p, unsigned int n, colour fill,
}
-bool ro_save_draw_fill(int x0, int y0, int x1, int y1, colour c)
+bool ro_save_draw_fill(int x0, int y0, int x1, int y1, plot_style_t *style)
{
pencil_code code;
const int path[] = { draw_MOVE_TO, x0 * 2, -y0 * 2 - 1,
@@ -313,10 +313,11 @@ bool ro_save_draw_fill(int x0, int y0, int x1, int y1, colour c)
draw_END_PATH };
code = pencil_path(ro_save_draw_diagram, path,
- sizeof path / sizeof path[0],
- c << 8, pencil_TRANSPARENT, 0, pencil_JOIN_MITRED,
- pencil_CAP_BUTT, pencil_CAP_BUTT, 0, 0, false,
- pencil_SOLID);
+ sizeof path / sizeof path[0],
+ style->fill_colour << 8,
+ pencil_TRANSPARENT, 0, pencil_JOIN_MITRED,
+ pencil_CAP_BUTT, pencil_CAP_BUTT, 0, 0, false,
+ pencil_SOLID);
if (code != pencil_OK)
return ro_save_draw_error(code);
diff --git a/riscos/window.c b/riscos/window.c
index 09b191ed1..5b73d8783 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -1483,7 +1483,7 @@ void ro_gui_window_redraw(wimp_draw *redraw)
plot.clip(clip_x0, clip_y0, clip_x1, clip_y1);
if (c->type != CONTENT_HTML)
- plot.fill(clip_x0, clip_y0, clip_x1, clip_y1, 0x00ffffff);
+ plot.fill(clip_x0, clip_y0, clip_x1, clip_y1, plot_style_fill_white);
/* Redraw the clip rectangle area of the content */
content_redraw(c, 0, 0,