summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2009-07-10 18:36:49 +0000
committerVincent Sanders <vince@netsurf-browser.org>2009-07-10 18:36:49 +0000
commit680298e61ce664e95b3f8143c0c0b814d5966f2a (patch)
treecd4bdf673143a3ff8496498927de526adfb9804e /framebuffer
parent5feb7018c5228a22d370d070c1f7c3dad2c71e25 (diff)
downloadnetsurf-680298e61ce664e95b3f8143c0c0b814d5966f2a.tar.gz
netsurf-680298e61ce664e95b3f8143c0c0b814d5966f2a.tar.bz2
plotters line refactor
svn path=/trunk/netsurf/; revision=8446
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/framebuffer.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index 41ede39c6..0e8570211 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -226,6 +226,31 @@ framebuffer_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *s
return true;
}
+static bool
+framebuffer_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
+{
+ nsfb_bbox_t rect;
+ bool dotted = false;
+ bool dashed = false;
+
+ rect.x0 = x0;
+ rect.y0 = y0;
+ rect.x1 = x1;
+ rect.y1 = y1;
+
+ if (style->stroke_type != PLOT_OP_TYPE_NONE) {
+ if (style->stroke_type == PLOT_OP_TYPE_DOT)
+ dotted = true;
+
+ if (style->stroke_type == PLOT_OP_TYPE_DASH)
+ dashed = true;
+
+ nsfb_plot_line(nsfb, &rect, style->stroke_width, style->stroke_colour, dotted, dashed);
+ }
+
+ return true;
+}
+
static bool framebuffer_plot_flush(void)
{
LOG(("flush unimplemnted"));
@@ -246,7 +271,7 @@ framebuffer_plot_path(const float *p,
struct plotter_table plot = {
.rectangle = framebuffer_plot_rectangle,
- .line = nsfb_lplot_line,
+ .line = framebuffer_plot_line,
.polygon = nsfb_lplot_polygon,
.clip = nsfb_lplot_clip,
.text = framebuffer_plot_text,