add aa render function. (gnome_canvas_pixbuf_class_init): add

1999-11-02  Larry Ewing  <lewing@gimp.org>

	* src/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_render): add aa
	render function.
	(gnome_canvas_pixbuf_class_init): add gnome_canvas_pixbuf_render
	to class.
This commit is contained in:
Larry Ewing 1999-11-02 19:43:48 +00:00 committed by Larry Ewing
parent 0dcfd50a96
commit 9efff07116
2 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,10 @@
1999-11-02 Larry Ewing <lewing@gimp.org>
* src/gnome-canvas-pixbuf.c (gnome_canvas_pixbuf_render): add aa
render function.
(gnome_canvas_pixbuf_class_init): add gnome_canvas_pixbuf_render
to class.
1999-11-02 Federico Mena Quintero <federico@redhat.com>
* src/gnome-canvas-pixbuf.c (compute_render_affine): Moved the

View File

@ -24,6 +24,7 @@
#include <math.h>
#include "gdk-pixbuf.h"
#include "gnome-canvas-pixbuf.h"
#include "libart_lgpl/art_rgb_pixbuf_affine.h"
@ -79,6 +80,7 @@ static double gnome_canvas_pixbuf_point (GnomeCanvasItem *item, double x, double
GnomeCanvasItem **actual_item);
static void gnome_canvas_pixbuf_bounds (GnomeCanvasItem *item,
double *x1, double *y1, double *x2, double *y2);
static void gnome_canvas_pixbuf_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf);
static GnomeCanvasItemClass *parent_class;
@ -152,6 +154,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
item_class->draw = gnome_canvas_pixbuf_draw;
item_class->point = gnome_canvas_pixbuf_point;
item_class->bounds = gnome_canvas_pixbuf_bounds;
item_class->render = gnome_canvas_pixbuf_render;
}
/* Object initialization function for the pixbuf canvas item */
@ -671,6 +674,34 @@ transform_pixbuf (guchar *dest, int x, int y, int width, int height, int rowstri
}
}
/* Render for the pixbuf canvas item */
static void
gnome_canvas_pixbuf_render (GnomeCanvasItem *item, GnomeCanvasBuf *buf)
{
GnomeCanvasPixbuf *gcp;
PixbufPrivate *priv;
double 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);
art_rgb_pixbuf_affine (buf->buf,
buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1,
buf->buf_rowstride,
priv->pixbuf->art_pixbuf,
render_affine,
ART_FILTER_NEAREST, NULL);
buf->is_bg = 0;
}
/* Draw handler for the pixbuf canvas item */
static void
gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,