diff options
author | John Tytgat <joty@netsurf-browser.org> | 2009-02-03 01:27:54 +0000 |
---|---|---|
committer | John Tytgat <joty@netsurf-browser.org> | 2009-02-03 01:27:54 +0000 |
commit | fbf6d4cd4116dac4287403c52233f62bac88f3c0 (patch) | |
tree | 7f05710df78ef24f788fdeaa0cb186df5a3e77b6 /riscos | |
parent | 9a1751020684c410d7ad8824dd3cab7c5dd90733 (diff) | |
download | netsurf-fbf6d4cd4116dac4287403c52233f62bac88f3c0.tar.gz netsurf-fbf6d4cd4116dac4287403c52233f62bac88f3c0.tar.bz2 |
- Constify parameters of struct plotter_table::polygon and struct plotter_table::path
- riscos/save_draw.c(ro_save_draw_plotters): Make it static.
- desktop/save_pdf/pdf_plotters.c(pdf_plot_path): fix broken implementation (coordinates path were wrong, no clip/text mode update, transformation matrix was overwritten); only update fill and/or
stroke color when fill and/or stroke is done.
(pdf_begin): disable compression when PDF_DEBUG is set
svn path=/trunk/netsurf/; revision=6361
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/plotters.c | 12 | ||||
-rw-r--r-- | riscos/print.c | 12 | ||||
-rw-r--r-- | riscos/save_draw.c | 25 |
3 files changed, 23 insertions, 26 deletions
diff --git a/riscos/plotters.c b/riscos/plotters.c index bfba10c39..6b0ebee79 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -41,9 +41,9 @@ static bool ro_plot_line(int x0, int y0, int x1, int y1, int width, colour c, bool dotted, bool dashed); static bool ro_plot_draw_path(const draw_path * const path, int width, colour c, bool dotted, bool dashed); -static bool ro_plot_polygon(int *p, unsigned int n, colour fill); -static bool ro_plot_path(float *p, unsigned int n, colour fill, float width, - colour c, float *transform); +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_clip(int clip_x0, int clip_y0, int clip_x1, int clip_y1); @@ -190,7 +190,7 @@ bool ro_plot_draw_path(const draw_path * const path, int width, } -bool ro_plot_polygon(int *p, unsigned int n, colour fill) +bool ro_plot_polygon(const int *p, unsigned int n, colour fill) { int path[n * 3 + 2]; unsigned int i; @@ -222,8 +222,8 @@ bool ro_plot_polygon(int *p, unsigned int n, colour fill) } -bool ro_plot_path(float *p, unsigned int n, colour fill, float width, - colour c, float *transform) +bool ro_plot_path(const float *p, unsigned int n, colour fill, float width, + colour c, const float transform[6]) { static const draw_line_style line_style = { draw_JOIN_MITRED, draw_CAP_BUTT, draw_CAP_BUTT, 0, 0x7fffffff, diff --git a/riscos/print.c b/riscos/print.c index 8edc24afd..008d63cbc 100644 --- a/riscos/print.c +++ b/riscos/print.c @@ -103,7 +103,7 @@ static bool print_fonts_plot_rectangle(int x0, int y0, int width, int height, int line_width, colour c, bool dotted, bool dashed); 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(int *p, unsigned int n, colour fill); +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_clip(int clip_x0, int clip_y0, int clip_x1, int clip_y1); @@ -119,8 +119,8 @@ static bool print_fonts_plot_bitmap(int x, int y, int width, int height, static bool print_fonts_plot_bitmap_tile(int x, int y, int width, int height, struct bitmap *bitmap, colour bg, bool repeat_x, bool repeat_y, struct content *content); -static bool print_fonts_plot_path(float *p, unsigned int n, colour fill, float width, - colour c, float *transform); +static bool print_fonts_plot_path(const float *p, unsigned int n, colour fill, float width, + colour c, const float transform[6]); static void print_fonts_callback(void *context, const char *font_name, unsigned int font_size, const char *s8, unsigned short *s16, unsigned int n, @@ -831,7 +831,7 @@ bool print_fonts_plot_line(int x0, int y0, int x1, int y1, int width, { return true; } -bool print_fonts_plot_polygon(int *p, unsigned int n, colour fill) +bool print_fonts_plot_polygon(const int *p, unsigned int n, colour fill) { return true; } @@ -865,8 +865,8 @@ bool print_fonts_plot_bitmap_tile(int x, int y, int width, int height, { return true; } -bool print_fonts_plot_path(float *p, unsigned int n, colour fill, float width, - colour c, float *transform) +bool print_fonts_plot_path(const float *p, unsigned int n, colour fill, float width, + colour c, const float transform[6]) { return true; } diff --git a/riscos/save_draw.c b/riscos/save_draw.c index fe3dae533..57add139b 100644 --- a/riscos/save_draw.c +++ b/riscos/save_draw.c @@ -41,9 +41,9 @@ static bool ro_save_draw_rectangle(int x0, int y0, int width, int height, int line_width, colour c, bool dotted, bool dashed); static bool ro_save_draw_line(int x0, int y0, int x1, int y1, int width, colour c, bool dotted, bool dashed); -static bool ro_save_draw_polygon(int *p, unsigned int n, colour fill); -static bool ro_save_draw_path(float *p, unsigned int n, colour fill, - float width, colour c, float *transform); +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_clip(int clip_x0, int clip_y0, int clip_x1, int clip_y1); @@ -63,7 +63,7 @@ static bool ro_save_draw_group_end(void); static bool ro_save_draw_error(pencil_code code); -const struct plotter_table ro_save_draw_plotters = { +static const struct plotter_table ro_save_draw_plotters = { ro_save_draw_clg, ro_save_draw_rectangle, ro_save_draw_line, @@ -199,7 +199,7 @@ bool ro_save_draw_line(int x0, int y0, int x1, int y1, int width, } -bool ro_save_draw_polygon(int *p, unsigned int n, colour fill) +bool ro_save_draw_polygon(const int *p, unsigned int n, colour fill) { pencil_code code; int path[n * 3 + 1]; @@ -224,14 +224,9 @@ bool ro_save_draw_polygon(int *p, unsigned int n, colour fill) } -bool ro_save_draw_path(float *p, unsigned int n, colour fill, - float width, colour c, float *transform) +bool ro_save_draw_path(const float *p, unsigned int n, colour fill, + float width, colour c, const float transform[6]) { - pencil_code code; - int *path; - unsigned int i; - bool empty_path = true; - if (n == 0) return true; @@ -240,12 +235,14 @@ bool ro_save_draw_path(float *p, unsigned int n, colour fill, return false; } - path = malloc(sizeof *path * (n + 10)); + int *path = malloc(sizeof *path * (n + 10)); if (!path) { LOG(("out of memory")); return false; } + unsigned int i; + bool empty_path = true; for (i = 0; i < n; ) { if (p[i] == PLOTTER_PATH_MOVE) { path[i] = draw_MOVE_TO; @@ -304,7 +301,7 @@ bool ro_save_draw_path(float *p, unsigned int n, colour fill, return true; } - code = pencil_path(ro_save_draw_diagram, path, i + 1, + pencil_code code = pencil_path(ro_save_draw_diagram, path, i + 1, fill == TRANSPARENT ? pencil_TRANSPARENT : fill << 8, c == TRANSPARENT ? pencil_TRANSPARENT : c << 8, width, pencil_JOIN_MITRED, |