From b0fa2b299df69c8d34ba2f5c7083e9632a7106cf Mon Sep 17 00:00:00 2001 From: François Revel Date: Sat, 7 Jun 2008 01:13:07 +0000 Subject: Add copyrights Notes on a plot_path implementation. svn path=/trunk/netsurf/; revision=4292 --- beos/beos_plotters.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'beos/beos_plotters.cpp') diff --git a/beos/beos_plotters.cpp b/beos/beos_plotters.cpp index 89266d64c..d26eb3e9e 100644 --- a/beos/beos_plotters.cpp +++ b/beos/beos_plotters.cpp @@ -1,4 +1,5 @@ /* + * Copyright 2008 François Revol * Copyright 2006 Rob Kendrick * Copyright 2005 James Bursa * @@ -27,6 +28,7 @@ #include #include #include +#include extern "C" { #include "desktop/plotters.h" #include "render/font.h" @@ -687,6 +689,52 @@ bool nsbeos_plot_bitmap_tile(int x, int y, int width, int height, bool nsbeos_plot_path(float *p, unsigned int n, colour fill, float width, colour c, float *transform) { + unsigned int i; + + if (n == 0) + return true; + + if (p[0] != PLOTTER_PATH_MOVE) { + LOG(("path doesn't start with a move")); + return false; + } + + BShape shape; + +#if 0 + for (i = 0; i < n; ) { + if (p[i] == PLOTTER_PATH_MOVE) { + path[i] = draw_MOVE_TO; + path[i + 1] = p[i + 1] * 2 * 256; + path[i + 2] = -p[i + 2] * 2 * 256; + i += 3; + } else if (p[i] == PLOTTER_PATH_CLOSE) { + path[i] = draw_CLOSE_LINE; + i++; + } else if (p[i] == PLOTTER_PATH_LINE) { + path[i] = draw_LINE_TO; + path[i + 1] = p[i + 1] * 2 * 256; + path[i + 2] = -p[i + 2] * 2 * 256; + i += 3; + } else if (p[i] == PLOTTER_PATH_BEZIER) { + path[i] = draw_BEZIER_TO; + path[i + 1] = p[i + 1] * 2 * 256; + path[i + 2] = -p[i + 2] * 2 * 256; + path[i + 3] = p[i + 3] * 2 * 256; + path[i + 4] = -p[i + 4] * 2 * 256; + path[i + 5] = p[i + 5] * 2 * 256; + path[i + 6] = -p[i + 6] * 2 * 256; + i += 7; + } else { + LOG(("bad path command %f", p[i])); + goto error; + } + } + path[i] = draw_END_PATH; + path[i + 1] = 0; +#endif + + //StrokeBezier #warning WRITEME #if 0 /* GTK */ /* Only the internal SVG renderer uses this plot call currently, -- cgit v1.2.3