aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-08 21:37:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:49:58 +0800
commitbac4bdb7a564c248b6a09e417da8098455ecdb62 (patch)
tree698aa7ef7ffd10696819afd907c825663c5bb64c
parentdf70b76a554a94335e14ede2d7cbc5e1ec7fd7d6 (diff)
downloadgsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar.gz
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar.bz2
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar.lz
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar.xz
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.tar.zst
gsoc2013-evolution-bac4bdb7a564c248b6a09e417da8098455ecdb62.zip
gnome-canvas: Remove GnomeCanvasItem->render vfunc
It's unused now
-rw-r--r--libgnomecanvas/gnome-canvas-clipgroup.c168
-rw-r--r--libgnomecanvas/gnome-canvas-line.c55
-rw-r--r--libgnomecanvas/gnome-canvas-pixbuf.c92
-rw-r--r--libgnomecanvas/gnome-canvas-rich-text.c9
-rw-r--r--libgnomecanvas/gnome-canvas-shape.c21
-rw-r--r--libgnomecanvas/gnome-canvas-text.c116
-rw-r--r--libgnomecanvas/gnome-canvas-widget.c18
-rw-r--r--libgnomecanvas/gnome-canvas.c32
-rw-r--r--libgnomecanvas/gnome-canvas.h8
9 files changed, 0 insertions, 519 deletions
diff --git a/libgnomecanvas/gnome-canvas-clipgroup.c b/libgnomecanvas/gnome-canvas-clipgroup.c
index 350cb643bb..fae19fa60c 100644
--- a/libgnomecanvas/gnome-canvas-clipgroup.c
+++ b/libgnomecanvas/gnome-canvas-clipgroup.c
@@ -73,20 +73,6 @@ static void gnome_canvas_clipgroup_update (GnomeCanvasItem *i
* although I am not sure.
*/
-#define GCG_BUF_WIDTH 128
-#define GCG_BUF_HEIGHT 128
-#define GCG_BUF_PIXELS (GCG_BUF_WIDTH * GCG_BUF_HEIGHT)
-#define GCG_BUF_SIZE (GCG_BUF_WIDTH * GCG_BUF_HEIGHT * 3)
-
-#define noSHOW_SHADOW
-
-static guchar *gcg_buf_new (void);
-static void gcg_buf_free (guchar *buf);
-static guchar *gcg_mask_new (void);
-static void gcg_mask_free (guchar *mask);
-
-static void gnome_canvas_clipgroup_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
-
static GnomeCanvasGroupClass *parent_class;
GType
@@ -129,7 +115,6 @@ gnome_canvas_clipgroup_class_init (GnomeCanvasClipgroupClass *klass)
gobject_class->get_property = gnome_canvas_clipgroup_get_property;
item_class->destroy = gnome_canvas_clipgroup_destroy;
item_class->update = gnome_canvas_clipgroup_update;
- item_class->render = gnome_canvas_clipgroup_render;
g_object_class_install_property (gobject_class,
PROP_PATH,
@@ -292,156 +277,3 @@ gnome_canvas_clipgroup_update (GnomeCanvasItem *item, gdouble *affine, ArtSVP *c
item->y2 = MIN (item->y2, cbox.y1 + 1.0);
}
}
-
-/* non-premultiplied composition into RGB */
-
-#define COMPOSEN11(fc,fa,bc) (((255 - (guint) (fa)) * (guint) (bc) + (guint) (fc) * (guint) (fa) + 127) / 255)
-
-static void
-gnome_canvas_clipgroup_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
-{
- GnomeCanvasClipgroup *cg;
- GnomeCanvasBuf lbuf;
- guchar *mask;
-
- cg = GNOME_CANVAS_CLIPGROUP (item);
-
- if (cg->svp) {
- gint bw, bh, sw, sh;
- gint x, y;
-
- /* fixme: We could optimize background handling (lauris) */
-
- if (buf->is_bg) {
- gnome_canvas_buf_ensure_buf (buf);
- buf->is_bg = FALSE;
- buf->is_buf = TRUE;
- }
-
- bw = buf->rect.x1 - buf->rect.x0;
- bh = buf->rect.y1 - buf->rect.y0;
- if ((bw < 1) || (bh < 1)) return;
-
- if (bw * bh <= GCG_BUF_PIXELS) {
- /* We can go with single buffer */
- sw = bw;
- sh = bh;
- } else if (bw <= (GCG_BUF_PIXELS >> 3)) {
- /* Go with row buffer */
- sw = bw;
- sh = GCG_BUF_PIXELS / bw;
- } else if (bh <= (GCG_BUF_PIXELS >> 3)) {
- /* Go with column buffer */
- sw = GCG_BUF_PIXELS / bh;
- sh = bh;
- } else {
- /* Tile buffer */
- sw = GCG_BUF_WIDTH;
- sh = GCG_BUF_HEIGHT;
- }
-
- /* Set up local buffer */
- lbuf.buf = gcg_buf_new ();
- lbuf.bg_color = buf->bg_color;
- lbuf.is_bg = FALSE;
- lbuf.is_buf = TRUE;
- /* Allocate mask */
- mask = gcg_mask_new ();
-
- for (y = buf->rect.y0; y < buf->rect.y1; y += sh) {
- for (x = buf->rect.x0; x < buf->rect.x1; x += sw) {
- gint r, xx, yy;
- /* Set up local buffer */
- lbuf.rect.x0 = x;
- lbuf.rect.y0 = y;
- lbuf.rect.x1 = MIN (x + sw, buf->rect.x1);
- lbuf.rect.y1 = MIN (y + sh, buf->rect.y1);
- lbuf.buf_rowstride = 3 * (lbuf.rect.x1 - lbuf.rect.x0);
- /* Copy background */
- for (r = lbuf.rect.y0; r < lbuf.rect.y1; r++) {
- memcpy (lbuf.buf + (r - lbuf.rect.y0) * lbuf.buf_rowstride,
- buf->buf + (r - buf->rect.y0) * buf->buf_rowstride + (x - buf->rect.x0) * 3,
- (lbuf.rect.x1 - lbuf.rect.x0) * 3);
- }
- /* Invoke render method */
- if (((GnomeCanvasItemClass *) parent_class)->render)
- ((GnomeCanvasItemClass *) parent_class)->render (item, &lbuf);
- /* Render mask */
- art_gray_svp_aa (cg->svp, lbuf.rect.x0, lbuf.rect.y0, lbuf.rect.x1, lbuf.rect.y1,
- mask, lbuf.rect.x1 - lbuf.rect.x0);
- /* Combine */
- for (yy = lbuf.rect.y0; yy < lbuf.rect.y1; yy++) {
- guchar *s, *m, *d;
- s = lbuf.buf + (yy - lbuf.rect.y0) * lbuf.buf_rowstride;
- m = mask + (yy - lbuf.rect.y0) * (lbuf.rect.x1 - lbuf.rect.x0);
- d = buf->buf + (yy - buf->rect.y0) * buf->buf_rowstride + (x - buf->rect.x0) * 3;
- for (xx = lbuf.rect.x0; xx < lbuf.rect.x1; xx++) {
-#ifndef SHOW_SHADOW
- d[0] = COMPOSEN11 (s[0], m[0], d[0]);
- d[1] = COMPOSEN11 (s[1], m[0], d[1]);
- d[2] = COMPOSEN11 (s[2], m[0], d[2]);
-#else
- d[0] = COMPOSEN11 (s[0], m[0] | 0x7f, d[0]);
- d[1] = COMPOSEN11 (s[1], m[0] | 0x7f, d[1]);
- d[2] = COMPOSEN11 (s[2], m[0] | 0x7f, d[2]);
-#endif
- s += 3;
- m += 1;
- d += 3;
- }
- }
- }
- }
- /* Free buffers */
- gcg_mask_free (mask);
- gcg_buf_free (lbuf.buf);
- } else {
- if (((GnomeCanvasItemClass *) parent_class)->render)
- ((GnomeCanvasItemClass *) parent_class)->render (item, buf);
- }
-}
-
-static GSList *gcg_buffers = NULL;
-static GSList *gcg_masks = NULL;
-
-static guchar *
-gcg_buf_new (void)
-{
- guchar *buf;
-
- if (!gcg_buffers) {
- buf = g_new (guchar, GCG_BUF_SIZE);
- } else {
- buf = (guchar *) gcg_buffers->data;
- gcg_buffers = g_slist_remove (gcg_buffers, buf);
- }
-
- return buf;
-}
-
-static void
-gcg_buf_free (guchar *buf)
-{
- gcg_buffers = g_slist_prepend (gcg_buffers, buf);
-}
-
-static guchar *
-gcg_mask_new (void)
-{
- guchar *mask;
-
- if (!gcg_masks) {
- mask = g_new (guchar, GCG_BUF_PIXELS);
- } else {
- mask = (guchar *) gcg_masks->data;
- gcg_masks = g_slist_remove (gcg_masks, mask);
- }
-
- return mask;
-}
-
-static void
-gcg_mask_free (guchar *mask)
-{
- gcg_masks = g_slist_prepend (gcg_masks, mask);
-}
diff --git a/libgnomecanvas/gnome-canvas-line.c b/libgnomecanvas/gnome-canvas-line.c
index 7488eff9de..c862a1f456 100644
--- a/libgnomecanvas/gnome-canvas-line.c
+++ b/libgnomecanvas/gnome-canvas-line.c
@@ -102,7 +102,6 @@ static void gnome_canvas_line_draw (GnomeCanvasItem *item, GdkDrawable
static gdouble gnome_canvas_line_point (GnomeCanvasItem *item, gdouble x, gdouble y,
gint cx, gint cy, GnomeCanvasItem **actual_item);
static void gnome_canvas_line_bounds (GnomeCanvasItem *item, gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2);
-static void gnome_canvas_line_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
static GnomeCanvasItemClass *parent_class;
@@ -259,8 +258,6 @@ gnome_canvas_line_class_init (GnomeCanvasLineClass *class)
item_class->draw = gnome_canvas_line_draw;
item_class->point = gnome_canvas_line_point;
item_class->bounds = gnome_canvas_line_bounds;
-
- item_class->render = gnome_canvas_line_render;
}
static void
@@ -955,58 +952,6 @@ gnome_canvas_line_get_property (GObject *object,
}
static void
-gnome_canvas_line_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf)
-{
- GnomeCanvasLine *line;
-
- line = GNOME_CANVAS_LINE (item);
-
- if (line->fill_svp != NULL)
- gnome_canvas_render_svp (buf, line->fill_svp, line->fill_rgba);
-
- if (line->first_svp != NULL)
- gnome_canvas_render_svp (buf, line->first_svp, line->fill_rgba);
-
- if (line->last_svp != NULL)
- gnome_canvas_render_svp (buf, line->last_svp, line->fill_rgba);
-}
-
-static ArtSVP *
-svp_from_points (const gdouble *item_coords, gint num_points, const gdouble affine[6])
-{
- ArtVpath *vpath;
- ArtSVP *svp;
- gdouble x, y;
- gint i;
-
- vpath = art_new (ArtVpath, num_points + 2);
-
- for (i = 0; i < num_points; i++) {
- vpath[i].code = i == 0 ? ART_MOVETO : ART_LINETO;
- x = item_coords[i * 2];
- y = item_coords[i * 2 + 1];
- vpath[i].x = x * affine[0] + y * affine[2] + affine[4];
- vpath[i].y = x * affine[1] + y * affine[3] + affine[5];
- }
-#if 0
- vpath[i].code = ART_LINETO;
- vpath[i].x = vpath[0].x;
- vpath[i].y = vpath[0].y;
- i++;
-#endif
- vpath[i].code = ART_END;
- vpath[i].x = 0;
- vpath[i].y = 0;
-
- svp = art_svp_from_vpath (vpath);
-
- art_free (vpath);
-
- return svp;
-}
-
-static void
gnome_canvas_line_update (GnomeCanvasItem *item, gdouble *affine, ArtSVP *clip_path, gint flags)
{
GnomeCanvasLine *line;
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c
index 9ae353b1f8..b591724153 100644
--- a/libgnomecanvas/gnome-canvas-pixbuf.c
+++ b/libgnomecanvas/gnome-canvas-pixbuf.c
@@ -93,7 +93,6 @@ static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, gdouble *affine,
ArtSVP *clip_path, gint flags);
static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
gint x, gint y, gint width, gint height);
-static void gnome_canvas_pixbuf_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
static gdouble gnome_canvas_pixbuf_point (GnomeCanvasItem *item,
gdouble x,
gdouble y,
@@ -227,7 +226,6 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
item_class->destroy = gnome_canvas_pixbuf_destroy;
item_class->update = gnome_canvas_pixbuf_update;
item_class->draw = gnome_canvas_pixbuf_draw;
- item_class->render = gnome_canvas_pixbuf_render;
item_class->point = gnome_canvas_pixbuf_point;
item_class->bounds = gnome_canvas_pixbuf_bounds;
}
@@ -815,96 +813,6 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
g_free (buf);
}
-/* Render handler for the pixbuf canvas item */
-static void
-gnome_canvas_pixbuf_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
-{
- GnomeCanvasPixbuf *gcp;
- PixbufPrivate *priv;
- gdouble i2c[6], render_affine[6];
-
- gcp = GNOME_CANVAS_PIXBUF (item);
- priv = gcp->priv;
-
- if (!priv->pixbuf)
- return;
-
- gnome_canvas_item_i2c_affine (item, i2c);
- compute_render_affine (gcp, render_affine, i2c);
- gnome_canvas_buf_ensure_buf (buf);
-
- if ((fabs (render_affine[1]) < GNOME_CANVAS_EPSILON) &&
- (fabs (render_affine[2]) < GNOME_CANVAS_EPSILON) &&
- render_affine[0] > 0.0 &&
- render_affine[3] > 0.0)
- {
- GdkPixbuf *dest_pixbuf;
- gint x0, y0, x1, y1;
-
- dest_pixbuf = gdk_pixbuf_new_from_data (buf->buf,
- GDK_COLORSPACE_RGB,
- FALSE,
- 8,
- buf->rect.x1 - buf->rect.x0,
- buf->rect.y1 - buf->rect.y0,
- buf->buf_rowstride,
- NULL, NULL);
-
- x0 = floor (render_affine[4] - buf->rect.x0 + 0.5);
- y0 = floor (render_affine[5] - buf->rect.y0 + 0.5);
-
- x1 = x0 + floor (gdk_pixbuf_get_width (priv->pixbuf) * render_affine[0] + 0.5);
- y1 = y0 + floor (gdk_pixbuf_get_height (priv->pixbuf) * render_affine[3] + 0.5);
-
- x0 = MAX (x0, 0);
- x0 = MIN (x0, buf->rect.x1 - buf->rect.x0);
- y0 = MAX (y0, 0);
- y0 = MIN (y0, buf->rect.y1 - buf->rect.y0);
-
- x1 = MAX (x1, 0);
- x1 = MIN (x1, buf->rect.x1 - buf->rect.x0);
- y1 = MAX (y1, 0);
- y1 = MIN (y1, buf->rect.y1 - buf->rect.y0);
-
- gdk_pixbuf_composite (priv->pixbuf,
- dest_pixbuf,
- x0, y0,
- x1 - x0, y1 - y0,
- render_affine[4] - buf->rect.x0,
- render_affine[5] - buf->rect.y0,
- render_affine[0],
- render_affine[3],
- GDK_INTERP_BILINEAR,
- 255);
-
- g_object_unref (dest_pixbuf);
- }
- else if (gdk_pixbuf_get_has_alpha (priv->pixbuf))
- art_rgb_rgba_affine (buf->buf,
- buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1,
- buf->buf_rowstride,
- gdk_pixbuf_get_pixels (priv->pixbuf),
- gdk_pixbuf_get_width (priv->pixbuf),
- gdk_pixbuf_get_height (priv->pixbuf),
- gdk_pixbuf_get_rowstride (priv->pixbuf),
- render_affine,
- ART_FILTER_NEAREST,
- NULL);
- else
- art_rgb_affine (buf->buf,
- buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1,
- buf->buf_rowstride,
- gdk_pixbuf_get_pixels (priv->pixbuf),
- gdk_pixbuf_get_width (priv->pixbuf),
- gdk_pixbuf_get_height (priv->pixbuf),
- gdk_pixbuf_get_rowstride (priv->pixbuf),
- render_affine,
- ART_FILTER_NEAREST,
- NULL);
-
- buf->is_bg = 0;
-}
-
/* Point handler for the pixbuf canvas item */
diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c
index 2decb1dfbf..5c7ed05709 100644
--- a/libgnomecanvas/gnome-canvas-rich-text.c
+++ b/libgnomecanvas/gnome-canvas-rich-text.c
@@ -128,8 +128,6 @@ static gdouble gnome_canvas_rich_text_point (GnomeCanvasItem *item,
static void gnome_canvas_rich_text_draw (GnomeCanvasItem *item,
GdkDrawable *drawable,
gint x, gint y, gint width, gint height);
-static void gnome_canvas_rich_text_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf);
static gint gnome_canvas_rich_text_event (GnomeCanvasItem *item,
GdkEvent *event);
static void gnome_canvas_rich_text_get_bounds (GnomeCanvasItem *text,
@@ -384,7 +382,6 @@ gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass)
item_class->unrealize = gnome_canvas_rich_text_unrealize;
item_class->draw = gnome_canvas_rich_text_draw;
item_class->point = gnome_canvas_rich_text_point;
- item_class->render = gnome_canvas_rich_text_render;
item_class->event = gnome_canvas_rich_text_event;
item_class->bounds = gnome_canvas_rich_text_get_bounds;
} /* gnome_canvas_rich_text_class_init */
@@ -2100,12 +2097,6 @@ gnome_canvas_rich_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
NULL);
} /* gnome_canvas_rich_text_draw */
-static void
-gnome_canvas_rich_text_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
-{
- g_warning ("rich text item not implemented for anti-aliased canvas");
-} /* gnome_canvas_rich_text_render */
-
#if 0
static GtkTextTag *
gnome_canvas_rich_text_add_tag (GnomeCanvasRichText *text, gchar *tag_name,
diff --git a/libgnomecanvas/gnome-canvas-shape.c b/libgnomecanvas/gnome-canvas-shape.c
index fa8a4bad7b..eb502d2c3b 100644
--- a/libgnomecanvas/gnome-canvas-shape.c
+++ b/libgnomecanvas/gnome-canvas-shape.c
@@ -79,7 +79,6 @@ static void gnome_canvas_shape_draw (GnomeCanvasItem *item, GdkDrawable
gint x, gint y, gint width, gint height);
static gdouble gnome_canvas_shape_point (GnomeCanvasItem *item, gdouble x, gdouble y,
gint cx, gint cy, GnomeCanvasItem **actual_item);
-static void gnome_canvas_shape_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
static void gnome_canvas_shape_bounds (GnomeCanvasItem *item,
gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2);
@@ -221,7 +220,6 @@ gnome_canvas_shape_class_init (GnomeCanvasShapeClass *class)
item_class->unrealize = gnome_canvas_shape_unrealize;
item_class->draw = gnome_canvas_shape_draw;
item_class->point = gnome_canvas_shape_point;
- item_class->render = gnome_canvas_shape_render;
item_class->bounds = gnome_canvas_shape_bounds;
}
@@ -665,25 +663,6 @@ gnome_canvas_shape_unrealize (GnomeCanvasItem *item)
}
static void
-gnome_canvas_shape_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf)
-{
- GnomeCanvasShape *shape;
-
- shape = GNOME_CANVAS_SHAPE (item);
-
- if (shape->priv->fill_svp != NULL)
- gnome_canvas_render_svp (buf,
- shape->priv->fill_svp,
- shape->priv->fill_rgba);
-
- if (shape->priv->outline_svp != NULL)
- gnome_canvas_render_svp (buf,
- shape->priv->outline_svp,
- shape->priv->outline_rgba);
-}
-
-static void
gnome_canvas_shape_draw (GnomeCanvasItem *item,
GdkDrawable *drawable,
gint x,
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index 16cc3f78ab..c59733b077 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -128,7 +128,6 @@ static gdouble gnome_canvas_text_point (GnomeCanvasItem *item,
GnomeCanvasItem **actual_item);
static void gnome_canvas_text_bounds (GnomeCanvasItem *item,
gdouble *x1, gdouble *y1, gdouble *x2, gdouble *y2);
-static void gnome_canvas_text_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
static void gnome_canvas_text_set_markup (GnomeCanvasText *textitem,
const gchar *markup);
@@ -510,7 +509,6 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class)
item_class->draw = gnome_canvas_text_draw;
item_class->point = gnome_canvas_text_point;
item_class->bounds = gnome_canvas_text_bounds;
- item_class->render = gnome_canvas_text_render;
}
/* Object initialization function for the text item */
@@ -1392,120 +1390,6 @@ gnome_canvas_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
gdk_gc_set_clip_rectangle (text->gc, NULL);
}
-/* Render handler for the text item */
-static void
-gnome_canvas_text_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
-{
- GnomeCanvasText *text;
- guint32 fg_color;
- gint render_x = 0, render_y = 0; /* offsets for text rendering,
- * for clipping rectangles */
- gint x, y;
- gint w, h;
- guchar *dst, *src;
- gint src_dx, src_dy;
- gint i, alpha;
- gint bm_rows, bm_width;
-
- text = GNOME_CANVAS_TEXT (item);
-
- if (!text->text)
- return;
-
- fg_color = text->rgba;
-
- gnome_canvas_buf_ensure_buf (buf);
-
- bm_rows = (text->clip) ? text->clip_cheight : text->height;
- bm_width = (text->clip) ? text->clip_cwidth : text->max_width;
- if (text->priv->render_dirty ||
- bm_rows != text->priv->bitmap.rows ||
- bm_width != text->priv->bitmap.width) {
- if (text->priv->bitmap.buffer) {
- g_free (text->priv->bitmap.buffer);
- }
- text->priv->bitmap.rows = bm_rows;
- text->priv->bitmap.width = bm_width;
- text->priv->bitmap.pitch = (text->priv->bitmap.width+3)&~3;
- text->priv->bitmap.buffer = g_malloc0 (
- text->priv->bitmap.rows * text->priv->bitmap.pitch);
- text->priv->bitmap.num_grays = 256;
- text->priv->bitmap.pixel_mode = ft_pixel_mode_grays;
-
- /* What this does is when a clipping rectangle is
- being used shift the rendering of the text by the
- correct amount so that the correct result is
- obtained as if all text was rendered, then clipped.
- In this sense we can use smaller buffers and less
- rendeirng since hopefully FreeType2 checks to see
- if the glyph falls in the bounding box before
- rasterizing it. */
-
- if (text->clip) {
- render_x = text->cx - text->clip_cx;
- render_y = text->cy - text->clip_cy;
- }
-
- pango_ft2_render_layout (&text->priv->bitmap, text->layout, render_x, render_y);
-
- text->priv->render_dirty = 0;
- }
-
- if (text->clip) {
- x = text->clip_cx - buf->rect.x0;
- y = text->clip_cy - buf->rect.y0;
- } else {
- x = text->cx - buf->rect.x0;
- y = text->cy - buf->rect.y0;
- }
-
- w = text->priv->bitmap.width;
- h = text->priv->bitmap.rows;
-
- src_dx = src_dy = 0;
-
- if (x + w > buf->rect.x1 - buf->rect.x0) {
- w = buf->rect.x1 - buf->rect.x0 - x;
- }
-
- if (y + h > buf->rect.y1 - buf->rect.y0) {
- h = buf->rect.y1 - buf->rect.y0 - y;
- }
-
- if (x < 0) {
- w -= - x;
- src_dx += - x;
- x = 0;
- }
-
- if (y < 0) {
- h -= -y;
- src_dy += - y;
- y = 0;
- }
-
- dst = buf->buf + y * buf->buf_rowstride + x * 3;
- src = text->priv->bitmap.buffer +
- src_dy * text->priv->bitmap.pitch + src_dx;
- while (h-- > 0) {
- i = w;
- while (i-- > 0) {
- /* FIXME: Do the libart thing instead of divide by 255 */
- alpha = ((fg_color & 0xff) * (*src)) / 255;
- dst[0] = (dst[0] * (255 - alpha) + ((fg_color >> 24) & 0xff) * alpha) / 255;
- dst[1] = (dst[1] * (255 - alpha) + ((fg_color >> 16) & 0xff) * alpha) / 255;
- dst[2] = (dst[2] * (255 - alpha) + ((fg_color >> 8) & 0xff) * alpha) / 255;
- dst += 3;
- src += 1;
- }
- dst += buf->buf_rowstride - w*3;
- src += text->priv->bitmap.pitch - w;
- }
-
- buf->is_bg = 0;
- return;
-}
-
/* Point handler for the text item */
static double
gnome_canvas_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c
index 85259f0ce0..2229803872 100644
--- a/libgnomecanvas/gnome-canvas-widget.c
+++ b/libgnomecanvas/gnome-canvas-widget.c
@@ -74,8 +74,6 @@ static void gnome_canvas_widget_bounds (GnomeCanvasItem *item,
gdouble *x2,
gdouble *y2);
-static void gnome_canvas_widget_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf);
static void gnome_canvas_widget_draw (GnomeCanvasItem *item,
GdkDrawable *drawable,
gint x,
@@ -166,7 +164,6 @@ gnome_canvas_widget_class_init (GnomeCanvasWidgetClass *class)
item_class->update = gnome_canvas_widget_update;
item_class->point = gnome_canvas_widget_point;
item_class->bounds = gnome_canvas_widget_bounds;
- item_class->render = gnome_canvas_widget_render;
item_class->draw = gnome_canvas_widget_draw;
}
@@ -412,21 +409,6 @@ gnome_canvas_widget_update (GnomeCanvasItem *item,
}
static void
-gnome_canvas_widget_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf)
-{
-#if 0
- GnomeCanvasWidget *witem;
-
- witem = GNOME_CANVAS_WIDGET (item);
-
- if (witem->widget)
- gtk_widget_queue_draw (witem->widget);
-#endif
-
-}
-
-static void
gnome_canvas_widget_draw (GnomeCanvasItem *item,
GdkDrawable *drawable,
gint x, gint y,
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index ecabf2a59c..4f84b9e8ab 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -1377,8 +1377,6 @@ static gdouble gnome_canvas_group_point (GnomeCanvasItem *item,
static void gnome_canvas_group_bounds (GnomeCanvasItem *item,
gdouble *x1, gdouble *y1,
gdouble *x2, gdouble *y2);
-static void gnome_canvas_group_render (GnomeCanvasItem *item,
- GnomeCanvasBuf *buf);
static GnomeCanvasItemClass *group_parent_class;
@@ -1454,7 +1452,6 @@ gnome_canvas_group_class_init (GnomeCanvasGroupClass *class)
item_class->map = gnome_canvas_group_map;
item_class->unmap = gnome_canvas_group_unmap;
item_class->draw = gnome_canvas_group_draw;
- item_class->render = gnome_canvas_group_render;
item_class->point = gnome_canvas_group_point;
item_class->bounds = gnome_canvas_group_bounds;
}
@@ -1848,35 +1845,6 @@ gnome_canvas_group_bounds (GnomeCanvasItem *item,
*y2 = maxy;
}
-/* Render handler for canvas groups */
-static void
-gnome_canvas_group_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
-{
- GnomeCanvasGroup *group;
- GnomeCanvasItem *child;
- GList *list;
-
- group = GNOME_CANVAS_GROUP (item);
-
- for (list = group->item_list; list; list = list->next) {
- child = list->data;
-
- if (((child->flags & GNOME_CANVAS_ITEM_VISIBLE)
- && ((child->x1 < buf->rect.x1)
- && (child->y1 < buf->rect.y1)
- && (child->x2 > buf->rect.x0)
- && (child->y2 > buf->rect.y0)))
- || ((child->flags & GNOME_CANVAS_ITEM_ALWAYS_REDRAW)
- && (child->x1 < child->canvas->redraw_x2)
- && (child->y1 < child->canvas->redraw_y2)
- && (child->x2 > child->canvas->redraw_x1)
- && (child->y2 > child->canvas->redraw_y2)))
- if (GNOME_CANVAS_ITEM_GET_CLASS (child)->render)
- (* GNOME_CANVAS_ITEM_GET_CLASS (child)->render) (
- child, buf);
- }
-}
-
/* Adds an item to a group */
static void
group_add (GnomeCanvasGroup *group, GnomeCanvasItem *item)
diff --git a/libgnomecanvas/gnome-canvas.h b/libgnomecanvas/gnome-canvas.h
index b8a7308d13..d6b35f0f55 100644
--- a/libgnomecanvas/gnome-canvas.h
+++ b/libgnomecanvas/gnome-canvas.h
@@ -197,14 +197,6 @@ struct _GnomeCanvasItemClass {
void (* draw) (GnomeCanvasItem *item, GdkDrawable *drawable,
gint x, gint y, gint width, gint height);
- /* Render the item over the buffer given. The buf data structure
- * contains both a pointer to a packed 24-bit RGB array, and the
- * coordinates. This method is only used for antialiased canvases.
- *
- * TODO: figure out where clip paths fit into the rendering framework.
- */
- void (* render) (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
-
/* Calculate the distance from an item to the specified point. It also
* returns a canvas item which is the item itself in the case of the
* object being an actual leaf item, or a child in case of the object