summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-01-09 00:12:23 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-01-09 00:12:23 +0000
commitf7cc98752fde7c7071dc3a605e19db1885ab3f96 (patch)
treeababd2b2351659a0bb91b19ca2a6a2be0fca0e5d /framebuffer
parent44a834a08d38cda321eb53ba1c56317191f690c4 (diff)
downloadnetsurf-f7cc98752fde7c7071dc3a605e19db1885ab3f96.tar.gz
netsurf-f7cc98752fde7c7071dc3a605e19db1885ab3f96.tar.bz2
remove use of legacy plot interface
svn path=/trunk/netsurf/; revision=9799
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/framebuffer.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c
index a9598e80e..ec86cf01e 100644
--- a/framebuffer/framebuffer.c
+++ b/framebuffer/framebuffer.c
@@ -25,7 +25,6 @@
#include <libnsfb.h>
#include <libnsfb_plot.h>
-#include <libnsfb_legacy_plot.h>
#include <libnsfb_event.h>
#include <libnsfb_cursor.h>
@@ -274,8 +273,7 @@ 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;
+ nsfb_plot_pen_t pen;
rect.x0 = x0;
rect.y0 = y0;
@@ -283,13 +281,20 @@ framebuffer_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
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;
+ if (style->stroke_type == PLOT_OP_TYPE_DOT) {
+ pen.stroke_type = NFSB_PLOT_OPTYPE_PATTERN;
+ pen.stroke_pattern = 0xAAAAAAAA;
+ } else if (style->stroke_type == PLOT_OP_TYPE_DASH) {
+ pen.stroke_type = NFSB_PLOT_OPTYPE_PATTERN;
+ pen.stroke_pattern = 0xF0F0F0F0;
+ } else {
+ pen.stroke_type = NFSB_PLOT_OPTYPE_SOLID;
+ }
- nsfb_plot_line(nsfb, &rect, style->stroke_width, style->stroke_colour, dotted, dashed);
+ pen.stroke_colour = style->stroke_colour;
+ pen.stroke_width = style->stroke_width;
+ nsfb_plot_line(nsfb, &rect, &pen);
}
return true;
@@ -308,8 +313,20 @@ framebuffer_plot_path(const float *p,
return true;
}
+static bool
+framebuffer_plot_clip(int x0, int y0, int x1, int y1)
+{
+ nsfb_bbox_t clip;
+ clip.x0 = x0;
+ clip.y0 = y0;
+ clip.x1 = x1;
+ clip.y1 = y1;
+
+ return nsfb_plot_set_clip(nsfb, &clip);
+}
+
struct plotter_table plot = {
- .clip = nsfb_lplot_clip,
+ .clip = framebuffer_plot_clip,
.arc = framebuffer_plot_arc,
.disc = framebuffer_plot_disc,
.line = framebuffer_plot_line,
@@ -370,8 +387,6 @@ framebuffer_initialise(int argc, char** argv)
return NULL;
}
- nsfb_lplot_ctx(nsfb);
-
return nsfb;
}