Bitmap plotter API cleanup

John-Mark Bell jmb at netsurf-browser.org
Tue Jun 30 11:50:24 BST 2009


On Tue, 2009-06-30 at 11:23 +0100, Vincent Sanders wrote:
> As most of you know I have been discussing cleaning up the plotter API
> with respect to the bitmap operations with a view to adding a bitmap
> cache in future.

Good. I'll update the plotter API wiki page with this :)

> There is a single "regression" from this alteration which is that the
> pdf save exporter will not currently directly embed the original jpegs
> into pdf...has anyone actually tested this with a modern haru? I have,
> its broken anyway! I do intend to fix this but as a seperate piece of
> work to make our haru handling less explody.

Wise. I've no strong opinion on this regression.

In general, this patch is fine, providing it builds for the platforms
you mentioned. Further comments below.

> Index: framebuffer/gui.h
> ===================================================================
> --- framebuffer/gui.h   (revision 8157)
> +++ framebuffer/gui.h   (working copy)
> @@ -24,16 +24,6 @@
>  /* bounding box */
>  typedef struct nsfb_bbox_s bbox_t;
>  
> -typedef struct framebuffer_s {
> -       int width;
> -       int height;
> -       uint8_t *ptr; /**< Base of video memory. */
> -       int linelen; /**< length of a video line. */
> -       int bpp;
> -       colour palette[256]; /* palette for index modes */
> -       fb_cursor_t *cursor;
> -} framebuffer_t;
> -
>  struct gui_window {
>          struct browser_window *bw;
>  
> @@ -50,7 +40,6 @@
>  };
>  
>  
> -extern framebuffer_t *framebuffer;
>  extern struct gui_window *window_list;

Changes to this file are unrelated, right?
 
> Index: gtk/gtk_print.c
> ===================================================================
> --- gtk/gtk_print.c     (revision 8157)
> +++ gtk/gtk_print.c     (working copy)
> @@ -91,22 +89,18 @@
>  static GdkRectangle cliprect;
>  
>  static const struct plotter_table nsgtk_print_plotters = {
> -       nsgtk_print_plot_clg,
> -       nsgtk_print_plot_rectangle,
> -       nsgtk_print_plot_line,
> -       nsgtk_print_plot_polygon,
> -       nsgtk_print_plot_fill,
> -       nsgtk_print_plot_clip,
> -       nsgtk_print_plot_text,
> -       nsgtk_print_plot_disc,
> -       nsgtk_print_plot_arc,
> -       nsgtk_print_plot_bitmap,
> -       nsgtk_print_plot_bitmap_tile,
> -       NULL,
> -       NULL,
> -       NULL,
> -       nsgtk_print_plot_path,
> -       false
> +       .clg = nsgtk_print_plot_clg,
> +       .rectangle = nsgtk_print_plot_rectangle,
> +       .line = nsgtk_print_plot_line,
> +       .polygon = nsgtk_print_plot_polygon,
> +       .fill = nsgtk_print_plot_fill,
> +       .clip = nsgtk_print_plot_clip,
> +       .text = nsgtk_print_plot_text,
> +       .disc = nsgtk_print_plot_disc,
> +       .arc = nsgtk_print_plot_arc,
> +       .bitmap = nsgtk_print_plot_bitmap_tile,

s/bitmap_tile/bitmap/ (and rename the function, too!)
This applies to a number of other plotter implementations, too.


J.




More information about the netsurf-dev mailing list