summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-10-20 23:31:32 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-10-20 23:31:32 +0000
commit963c3766d55c38c35d322099fe30b674e1d31c69 (patch)
tree6c9e550ce26a6818e3fe2759ea701e15d9c14e04
parent33d905ce7f95d1962586c76e5ac2288bb6a302c7 (diff)
downloadnetsurf-963c3766d55c38c35d322099fe30b674e1d31c69.tar.gz
netsurf-963c3766d55c38c35d322099fe30b674e1d31c69.tar.bz2
[project @ 2004-10-20 23:31:31 by jmb]
Reimplement draw groups svn path=/import/netsurf/; revision=1332
-rw-r--r--desktop/plotters.h2
-rw-r--r--gtk/gtk_plotters.c16
-rw-r--r--render/html_redraw.c11
-rw-r--r--riscos/plotters.c15
-rw-r--r--riscos/save_draw.c4
5 files changed, 42 insertions, 6 deletions
diff --git a/desktop/plotters.h b/desktop/plotters.h
index 7d2d89f71..0be1213a6 100644
--- a/desktop/plotters.h
+++ b/desktop/plotters.h
@@ -38,6 +38,8 @@ struct plotter_table {
bool (*bitmap_tile)(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bool repeat_x, bool repeat_y);
+ bool (*group_start)(const char *name);
+ bool (*group_end)(void);
};
/** Current plotters, must be assigned before use. */
diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c
index 86ba56fa9..3af8033a1 100644
--- a/gtk/gtk_plotters.c
+++ b/gtk/gtk_plotters.c
@@ -38,9 +38,12 @@ static bool nsgtk_plot_bitmap(int x, int y, int width, int height,
static bool nsgtk_plot_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bool repeat_x, bool repeat_y);
+static bool nsgtk_plot_group_start(const char *name);
+static bool nsgtk_plot_group_end(void);
static void nsgtk_set_colour(colour c);
+
struct plotter_table plot;
const struct plotter_table nsgtk_plotters = {
@@ -53,7 +56,9 @@ const struct plotter_table nsgtk_plotters = {
nsgtk_plot_text,
nsgtk_plot_disc,
nsgtk_plot_bitmap,
- nsgtk_plot_bitmap_tile
+ nsgtk_plot_bitmap_tile,
+ nsgtk_plot_group_start,
+ nsgtk_plot_group_end
};
@@ -194,6 +199,15 @@ bool nsgtk_plot_bitmap_tile(int x, int y, int width, int height,
return true;
}
+bool nsgtk_plot_group_start(const char *name)
+{
+ return true;
+}
+
+bool nsgtk_plot_group_end(void)
+{
+ return true;
+}
void nsgtk_set_colour(colour c)
{
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 0b88e06d8..c77cf4f54 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -145,14 +145,19 @@ bool html_redraw_box(struct box *box,
/* if visibility is hidden render children only */
if (box->style && box->style->visibility == CSS_VISIBILITY_HIDDEN) {
+ if (!plot.group_start("hidden box"))
+ return false;
for (c = box->children; c; c = c->next)
if (!html_redraw_box(c, x_scrolled, y_scrolled,
x0, y0, x1, y1,
scale, current_background_color))
return false;
- return true;
+ return plot.group_end();
}
+ if (!plot.group_start("vis box"))
+ return false;
+
/* dotted debug outlines */
if (html_redraw_debug) {
if (!plot.rectangle(x, y, padding_width, padding_height,
@@ -184,7 +189,7 @@ bool html_redraw_box(struct box *box,
/* return if the box is completely outside the clip rectangle */
if (clip_y1 < y0 || y1 < clip_y0 || clip_x1 < x0 || x1 < clip_x0)
- return true;
+ return plot.group_end();
if (box->type == BOX_BLOCK || box->type == BOX_INLINE_BLOCK ||
box->type == BOX_TABLE_CELL || box->object) {
@@ -350,7 +355,7 @@ bool html_redraw_box(struct box *box,
if (!plot.clip(clip_x0, clip_y0, clip_x1, clip_y1))
return false;
- return true;
+ return plot.group_end();
}
diff --git a/riscos/plotters.c b/riscos/plotters.c
index d12d50568..982fe7b15 100644
--- a/riscos/plotters.c
+++ b/riscos/plotters.c
@@ -37,6 +37,8 @@ static bool ro_plot_bitmap(int x, int y, int width, int height,
static bool ro_plot_bitmap_tile(int x, int y, int width, int height,
struct bitmap *bitmap, colour bg,
bool repeat_x, bool repeat_y);
+static bool ro_plot_group_start(const char *name);
+static bool ro_plot_group_end(void);
struct plotter_table plot;
@@ -51,7 +53,9 @@ const struct plotter_table ro_plotters = {
ro_plot_text,
ro_plot_disc,
ro_plot_bitmap,
- ro_plot_bitmap_tile
+ ro_plot_bitmap_tile,
+ ro_plot_group_start,
+ ro_plot_group_end
};
int ro_plot_origin_x = 0;
@@ -376,6 +380,15 @@ bool ro_plot_bitmap_tile(int x, int y, int width, int height,
IMAGE_PLOT_TINCT_ALPHA);
}
+bool ro_plot_group_start(const char *name)
+{
+ return true;
+}
+
+bool ro_plot_group_end(void)
+{
+ return true;
+}
/**
* Set the scale for subsequent text plotting.
diff --git a/riscos/save_draw.c b/riscos/save_draw.c
index a7bd22688..bda37d4d7 100644
--- a/riscos/save_draw.c
+++ b/riscos/save_draw.c
@@ -109,7 +109,9 @@ const struct plotter_table draw_plotters = {
draw_plot_text,
draw_plot_disc,
draw_plot_bitmap,
- draw_plot_bitmap_tile
+ draw_plot_bitmap_tile,
+ drawbuf_group_begin,
+ drawbuf_group_end
};
static int draw_plot_origin_y = 0; /* plot origin, in browser units */