diff options
author | François Revel <mmu_man@netsurf-browser.org> | 2008-06-07 01:13:07 +0000 |
---|---|---|
committer | François Revel <mmu_man@netsurf-browser.org> | 2008-06-07 01:13:07 +0000 |
commit | b0fa2b299df69c8d34ba2f5c7083e9632a7106cf (patch) | |
tree | ae7a256b13de283f9956d7d62a98eabfd9cdce63 /beos/beos_plotters.cpp | |
parent | 87df7ca228be55b8a11f1dbe7691a731af3454de (diff) | |
download | netsurf-b0fa2b299df69c8d34ba2f5c7083e9632a7106cf.tar.gz netsurf-b0fa2b299df69c8d34ba2f5c7083e9632a7106cf.tar.bz2 |
Add copyrights
Notes on a plot_path implementation.
svn path=/trunk/netsurf/; revision=4292
Diffstat (limited to 'beos/beos_plotters.cpp')
-rw-r--r-- | beos/beos_plotters.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
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 <mmu_man@users.sourceforge.net> * Copyright 2006 Rob Kendrick <rjek@rjek.com> * Copyright 2005 James Bursa <bursa@users.sourceforge.net> * @@ -27,6 +28,7 @@ #include <GraphicsDefs.h> #include <Region.h> #include <View.h> +#include <Shape.h> 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, |