Remove unused RsvgRender vfuncs

The render_image and get_image_of_node vfuncs are obsoleted by the
corresponding cairo_surface_t versions.
parent dccf2281
......@@ -1956,12 +1956,6 @@ rsvg_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
rsvg_render_markers (ctx, path);
}
void
rsvg_render_image (RsvgDrawingCtx * ctx, GdkPixbuf * pb, double x, double y, double w, double h)
{
ctx->render->render_image (ctx, pb, x, y, w, h);
}
void
rsvg_render_surface (RsvgDrawingCtx * ctx, cairo_surface_t *surface, double x, double y, double w, double h)
{
......@@ -1977,12 +1971,6 @@ rsvg_add_clipping_rect (RsvgDrawingCtx * ctx, double x, double y, double w, doub
ctx->render->add_clipping_rect (ctx, x, y, w, h);
}
GdkPixbuf *
rsvg_get_image_of_node (RsvgDrawingCtx * ctx, RsvgNode * drawable, double w, double h)
{
return ctx->render->get_image_of_node (ctx, drawable, w, h);
}
cairo_surface_t *
rsvg_get_surface_of_node (RsvgDrawingCtx * ctx, RsvgNode * drawable, double w, double h)
{
......
......@@ -77,13 +77,6 @@ rsvg_cairo_clip_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
cairo_append_path (cr, path);
}
static void
rsvg_cairo_clip_render_image (RsvgDrawingCtx * ctx,
const GdkPixbuf * pixbuf,
double pixbuf_x, double pixbuf_y, double w, double h)
{
}
static void
rsvg_cairo_clip_render_surface (RsvgDrawingCtx *ctx,
cairo_surface_t *surface,
......@@ -131,13 +124,11 @@ rsvg_cairo_clip_render_new (cairo_t * cr, RsvgCairoRender *parent)
render->free = rsvg_cairo_clip_render_free;
render->create_pango_context = rsvg_cairo_create_pango_context;
render->render_pango_layout = rsvg_cairo_render_pango_layout;
render->render_image = rsvg_cairo_clip_render_image;
render->render_surface = rsvg_cairo_clip_render_surface;
render->render_path = rsvg_cairo_clip_render_path;
render->pop_discrete_layer = rsvg_cairo_clip_pop_discrete_layer;
render->push_discrete_layer = rsvg_cairo_clip_push_discrete_layer;
render->add_clipping_rect = rsvg_cairo_clip_add_clipping_rect;
render->get_image_of_node = NULL;
render->get_surface_of_node = NULL;
cairo_render->initial_cr = parent->cr;
cairo_render->cr = cr;
......
......@@ -543,23 +543,6 @@ rsvg_cairo_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path)
rsvg_cairo_pop_discrete_layer (ctx);
}
void
rsvg_cairo_render_image (RsvgDrawingCtx * ctx, const GdkPixbuf * pixbuf,
double pixbuf_x, double pixbuf_y, double w, double h)
{
cairo_surface_t *surface;
if (pixbuf == NULL)
return;
surface = rsvg_cairo_surface_from_pixbuf (pixbuf);
if (surface == NULL)
return;
rsvg_cairo_render_surface (ctx, surface, pixbuf_x, pixbuf_y, w, h);
cairo_surface_destroy (surface);
}
void
rsvg_cairo_render_surface (RsvgDrawingCtx *ctx,
cairo_surface_t *surface,
......@@ -874,63 +857,6 @@ rsvg_cairo_add_clipping_rect (RsvgDrawingCtx * ctx, double x, double y, double w
cairo_clip (cr);
}
GdkPixbuf *
rsvg_cairo_get_image_of_node (RsvgDrawingCtx * ctx,
RsvgNode * drawable, double width, double height)
{
/* XXX: untested, should work */
GdkPixbuf *img = NULL;
cairo_surface_t *surface;
cairo_t *cr;
guint8 *pixels;
int rowstride;
RsvgCairoRender *save_render = (RsvgCairoRender *) ctx->render;
RsvgCairoRender *render;
rowstride = width * 4;
pixels = g_try_malloc0 (width * height * 4);
if (pixels == NULL)
return NULL;
/* no colorspace conversion necessary. this is just a convenient
holder of ARGB data with a width, height, & stride */
img = gdk_pixbuf_new_from_data (pixels,
GDK_COLORSPACE_RGB,
TRUE,
8,
width,
height,
rowstride,
(GdkPixbufDestroyNotify) rsvg_pixmap_destroy,
NULL);
surface = cairo_image_surface_create_for_data (pixels,
CAIRO_FORMAT_ARGB32, width, height, rowstride);
/* Also keep a reference to the pixbuf which owns the pixels */
cairo_surface_set_user_data (surface, &surface_pixel_data_key,
g_object_ref (img),
(cairo_destroy_func_t) g_object_unref);
cr = cairo_create (surface);
cairo_surface_destroy (surface);
render = rsvg_cairo_render_new (cr, width, height);
ctx->render = (RsvgRender *) render;
rsvg_state_push (ctx);
rsvg_node_draw (drawable, ctx, 0);
rsvg_state_pop (ctx);
cairo_destroy (cr);
rsvg_render_free (ctx->render);
ctx->render = (RsvgRender *) save_render;
return img;
}
cairo_surface_t *
rsvg_cairo_get_surface_of_node (RsvgDrawingCtx *ctx,
RsvgNode *drawable,
......
......@@ -37,8 +37,6 @@ void rsvg_cairo_render_pango_layout (RsvgDrawingCtx *ctx, PangoLayou
double x, double y);
void rsvg_cairo_render_path (RsvgDrawingCtx *ctx,
const cairo_path_t *path);
void rsvg_cairo_render_image (RsvgDrawingCtx *ctx, const GdkPixbuf * img,
double x, double y, double w, double h);
void rsvg_cairo_render_surface (RsvgDrawingCtx *ctx, cairo_surface_t *surface,
double x, double y, double w, double h);
void rsvg_cairo_push_discrete_layer (RsvgDrawingCtx *ctx);
......@@ -46,8 +44,6 @@ void rsvg_cairo_pop_discrete_layer (RsvgDrawingCtx *ctx);
void rsvg_cairo_add_clipping_rect (RsvgDrawingCtx *ctx,
double x, double y, double width, double height);
GdkPixbuf *rsvg_cairo_get_image_of_node (RsvgDrawingCtx *ctx, RsvgNode *drawable,
double width, double height);
cairo_surface_t*rsvg_cairo_get_surface_of_node (RsvgDrawingCtx *ctx, RsvgNode *drawable,
double width, double height);
......
......@@ -58,13 +58,11 @@ rsvg_cairo_render_new (cairo_t * cr, double width, double height)
cairo_render->super.free = rsvg_cairo_render_free;
cairo_render->super.create_pango_context = rsvg_cairo_create_pango_context;
cairo_render->super.render_pango_layout = rsvg_cairo_render_pango_layout;
cairo_render->super.render_image = rsvg_cairo_render_image;
cairo_render->super.render_surface = rsvg_cairo_render_surface;
cairo_render->super.render_path = rsvg_cairo_render_path;
cairo_render->super.pop_discrete_layer = rsvg_cairo_pop_discrete_layer;
cairo_render->super.push_discrete_layer = rsvg_cairo_push_discrete_layer;
cairo_render->super.add_clipping_rect = rsvg_cairo_add_clipping_rect;
cairo_render->super.get_image_of_node = rsvg_cairo_get_image_of_node;
cairo_render->super.get_surface_of_node = rsvg_cairo_get_surface_of_node;
cairo_render->width = width;
cairo_render->height = height;
......
......@@ -216,16 +216,12 @@ struct RsvgRender {
void (*render_pango_layout) (RsvgDrawingCtx * ctx, PangoLayout *layout,
double x, double y);
void (*render_path) (RsvgDrawingCtx * ctx, const cairo_path_t *path);
void (*render_image) (RsvgDrawingCtx * ctx, const GdkPixbuf * pixbuf,
double x, double y, double w, double h);
void (*render_surface) (RsvgDrawingCtx * ctx, cairo_surface_t *surface,
double x, double y, double w, double h);
void (*pop_discrete_layer) (RsvgDrawingCtx * ctx);
void (*push_discrete_layer) (RsvgDrawingCtx * ctx);
void (*add_clipping_rect) (RsvgDrawingCtx * ctx, double x, double y,
double w, double h);
GdkPixbuf *(*get_image_of_node) (RsvgDrawingCtx * ctx, RsvgNode * drawable,
double w, double h);
cairo_surface_t *(*get_surface_of_node) (RsvgDrawingCtx * ctx, RsvgNode * drawable,
double w, double h);
};
......@@ -376,14 +372,11 @@ GByteArray *_rsvg_acquire_xlink_href_resource (const char *href,
void rsvg_pop_discrete_layer (RsvgDrawingCtx * ctx);
void rsvg_push_discrete_layer (RsvgDrawingCtx * ctx);
void rsvg_render_path (RsvgDrawingCtx * ctx, const cairo_path_t *path);
void rsvg_render_image (RsvgDrawingCtx * ctx, GdkPixbuf * pb,
double x, double y, double w, double h);
void rsvg_render_surface (RsvgDrawingCtx * ctx, cairo_surface_t *surface,
double x, double y, double w, double h);
void rsvg_render_free (RsvgRender * render);
void rsvg_add_clipping_rect (RsvgDrawingCtx * ctx, double x, double y, double w, double h);
cairo_surface_t *rsvg_cairo_surface_from_pixbuf (const GdkPixbuf *pixbuf);
GdkPixbuf *rsvg_get_image_of_node (RsvgDrawingCtx * ctx, RsvgNode * drawable, double w, double h);
cairo_surface_t *rsvg_get_surface_of_node (RsvgDrawingCtx * ctx, RsvgNode * drawable, double w, double h);
void rsvg_node_set_atts (RsvgNode * node, RsvgHandle * ctx, RsvgPropertyBag * atts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment