diff options
author | Benjamin Otte <otte@redhat.com> | 2010-10-08 21:50:18 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 01:49:58 +0800 |
commit | 6c5699c895af9b0211ab0b3d83be57b49336ac29 (patch) | |
tree | 2ec75eba10af53987b3997157f638ae842c4023c /libgnomecanvas | |
parent | bac4bdb7a564c248b6a09e417da8098455ecdb62 (diff) | |
download | gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar.gz gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar.bz2 gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar.lz gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar.xz gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.tar.zst gsoc2013-evolution-6c5699c895af9b0211ab0b3d83be57b49336ac29.zip |
gnome-canvas: Remove GnomeCanvasBuf
It's not used anymore.
Diffstat (limited to 'libgnomecanvas')
-rw-r--r-- | libgnomecanvas/gnome-canvas-util.c | 84 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas-util.h | 6 | ||||
-rw-r--r-- | libgnomecanvas/gnome-canvas.h | 23 |
3 files changed, 0 insertions, 113 deletions
diff --git a/libgnomecanvas/gnome-canvas-util.c b/libgnomecanvas/gnome-canvas-util.c index 1aba6fcacd..8a21c548c7 100644 --- a/libgnomecanvas/gnome-canvas-util.c +++ b/libgnomecanvas/gnome-canvas-util.c @@ -382,64 +382,6 @@ gnome_canvas_polygon_to_point (gdouble *poly, gint num_points, gdouble x, gdoubl /* Here are some helper functions for aa rendering: */ /** - * gnome_canvas_render_svp: - * @buf: the canvas buffer to render over - * @svp: the vector path to render - * @rgba: the rgba color to render - * - * Render the svp over the buf. - **/ -void -gnome_canvas_render_svp (GnomeCanvasBuf *buf, ArtSVP *svp, guint32 rgba) -{ - guint32 fg_color, bg_color; - gint alpha; - - if (buf->is_bg) { - bg_color = buf->bg_color; - alpha = rgba & 0xff; - if (alpha == 0xff) - fg_color = rgba >> 8; - else { - /* composite over background color */ - gint bg_r, bg_g, bg_b; - gint fg_r, fg_g, fg_b; - gint tmp; - - bg_r = (bg_color >> 16) & 0xff; - fg_r = (rgba >> 24) & 0xff; - tmp = (fg_r - bg_r) * alpha; - fg_r = bg_r + ((tmp + (tmp >> 8) + 0x80) >> 8); - - bg_g = (bg_color >> 8) & 0xff; - fg_g = (rgba >> 16) & 0xff; - tmp = (fg_g - bg_g) * alpha; - fg_g = bg_g + ((tmp + (tmp >> 8) + 0x80) >> 8); - - bg_b = bg_color & 0xff; - fg_b = (rgba >> 8) & 0xff; - tmp = (fg_b - bg_b) * alpha; - fg_b = bg_b + ((tmp + (tmp >> 8) + 0x80) >> 8); - - fg_color = (fg_r << 16) | (fg_g << 8) | fg_b; - } - art_rgb_svp_aa (svp, - buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1, - fg_color, bg_color, - buf->buf, buf->buf_rowstride, - NULL); - buf->is_bg = 0; - buf->is_buf = 1; - } else { - art_rgb_svp_alpha (svp, - buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1, - rgba, - buf->buf, buf->buf_rowstride, - NULL); - } -} - -/** * gnome_canvas_update_svp: * @canvas: the canvas containing the svp that needs updating. * @p_svp: a pointer to the existing svp @@ -621,32 +563,6 @@ gnome_canvas_update_bbox (GnomeCanvasItem *item, gint x1, gint y1, gint x2, gint } /** - * gnome_canvas_buf_ensure_buf: - * @buf: the buf that needs to be represened in RGB format - * - * Ensure that the buffer is in RGB format, suitable for compositing. - **/ -void -gnome_canvas_buf_ensure_buf (GnomeCanvasBuf *buf) -{ - guchar *bufptr; - gint y; - - if (!buf->is_buf) { - bufptr = buf->buf; - for (y = buf->rect.y0; y < buf->rect.y1; y++) { - art_rgb_fill_run (bufptr, - buf->bg_color >> 16, - (buf->bg_color >> 8) & 0xff, - buf->bg_color & 0xff, - buf->rect.x1 - buf->rect.x0); - bufptr += buf->buf_rowstride; - } - buf->is_buf = 1; - } -} - -/** * gnome_canvas_join_gdk_to_art * @gdk_join: a join type, represented in GDK format * diff --git a/libgnomecanvas/gnome-canvas-util.h b/libgnomecanvas/gnome-canvas-util.h index 5ba0481399..1c43b65596 100644 --- a/libgnomecanvas/gnome-canvas-util.h +++ b/libgnomecanvas/gnome-canvas-util.h @@ -99,9 +99,6 @@ void gnome_canvas_get_butt_points (gdouble x1, gdouble y1, gdouble x2, gdouble y */ gdouble gnome_canvas_polygon_to_point (gdouble *poly, gint num_points, gdouble x, gdouble y); -/* Render the svp over the buf. */ -void gnome_canvas_render_svp (GnomeCanvasBuf *buf, ArtSVP *svp, guint32 rgba); - /* Sets the svp to the new value, requesting repaint on what's changed. This function takes responsibility for * freeing new_svp. */ @@ -138,9 +135,6 @@ void gnome_canvas_item_request_redraw_svp (GnomeCanvasItem *item, const ArtSVP * /* Sets the bbox to the new value, requesting full repaint. */ void gnome_canvas_update_bbox (GnomeCanvasItem *item, gint x1, gint y1, gint x2, gint y2); -/* Ensure that the buffer is in RGB format, suitable for compositing. */ -void gnome_canvas_buf_ensure_buf (GnomeCanvasBuf *buf); - /* Convert from GDK line join specifier to libart. */ ArtPathStrokeJoinType gnome_canvas_join_gdk_to_art (GdkJoinStyle gdk_join); diff --git a/libgnomecanvas/gnome-canvas.h b/libgnomecanvas/gnome-canvas.h index d6b35f0f55..fa51400073 100644 --- a/libgnomecanvas/gnome-canvas.h +++ b/libgnomecanvas/gnome-canvas.h @@ -107,29 +107,6 @@ enum { GNOME_CANVAS_UPDATE_IS_VISIBLE = 1 << 4 /* Deprecated. FIXME: remove this */ }; -/* Data for rendering in antialiased mode */ -typedef struct { - /* 24-bit RGB buffer for rendering */ - guchar *buf; - - /* Rectangle describing the rendering area */ - ArtIRect rect; - - /* Rowstride for the buffer */ - gint buf_rowstride; - - /* Background color, given as 0xrrggbb */ - guint32 bg_color; - - /* Invariant: at least one of the following flags is true. */ - - /* Set when the render rectangle area is the solid color bg_color */ - guint is_bg : 1; - - /* Set when the render rectangle area is represented by the buf */ - guint is_buf : 1; -} GnomeCanvasBuf; - #define GNOME_TYPE_CANVAS_ITEM (gnome_canvas_item_get_type ()) #define GNOME_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_CANVAS_ITEM, GnomeCanvasItem)) #define GNOME_CANVAS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_ITEM, GnomeCanvasItemClass)) |