[evolution] Remove unused libart_lgpl API.



commit d4a32e5a9867bc2dbd41ffa6e8eb3be44a70c00a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Jun 16 07:04:07 2010 -0400

    Remove unused libart_lgpl API.
    
    According to CallCatcher.

 libart_lgpl/Makefile.am             |   18 -
 libart_lgpl/art_affine.c            |  109 ---
 libart_lgpl/art_affine.h            |   24 -
 libart_lgpl/art_alphagamma.c        |   85 --
 libart_lgpl/art_alphagamma.h        |    6 -
 libart_lgpl/art_pixbuf.c            |  172 ----
 libart_lgpl/art_pixbuf.h            |   25 -
 libart_lgpl/art_rect.c              |   38 -
 libart_lgpl/art_rect.h              |    8 -
 libart_lgpl/art_render.c            |  552 -------------
 libart_lgpl/art_render.h            |   21 -
 libart_lgpl/art_render_gradient.c   |  716 ----------------
 libart_lgpl/art_render_gradient.h   |   81 --
 libart_lgpl/art_render_mask.c       |  168 ----
 libart_lgpl/art_render_mask.h       |   43 -
 libart_lgpl/art_render_svp.c        |  421 ----------
 libart_lgpl/art_render_svp.h        |   42 -
 libart_lgpl/art_rgb_a_affine.c      |  149 ----
 libart_lgpl/art_rgb_a_affine.h      |   47 --
 libart_lgpl/art_rgb_bitmap_affine.c |  198 -----
 libart_lgpl/art_rgb_bitmap_affine.h |   47 --
 libart_lgpl/art_rgb_pixbuf_affine.c |  104 ---
 libart_lgpl/art_rgb_pixbuf_affine.h |   46 -
 libart_lgpl/art_rgba.c              |  258 ------
 libart_lgpl/art_rgba.h              |   45 -
 libart_lgpl/art_svp_ops.c           |  155 ----
 libart_lgpl/art_svp_ops.h           |    3 -
 libart_lgpl/art_svp_wind.c          | 1545 -----------------------------------
 libart_lgpl/art_svp_wind.h          |    7 -
 libart_lgpl/art_uta_ops.c           |  112 ---
 libart_lgpl/art_uta_ops.h           |   38 -
 libart_lgpl/art_vpath.c             |  126 ---
 libart_lgpl/art_vpath.h             |    9 -
 libart_lgpl/libart.h                |    1 -
 libgnomecanvas/gnome-canvas-text.c  |    2 -
 libgnomecanvas/gnome-canvas.c       |    1 -
 36 files changed, 0 insertions(+), 5422 deletions(-)
---
diff --git a/libart_lgpl/Makefile.am b/libart_lgpl/Makefile.am
index bc45e33..8f71243 100644
--- a/libart_lgpl/Makefile.am
+++ b/libart_lgpl/Makefile.am
@@ -21,18 +21,11 @@ libart_lgplinclude_HEADERS = \
 	art_rect_svp.h \
 	art_rect_uta.h \
 	art_render.h \
-	art_render_gradient.h \
-	art_render_mask.h \
-	art_render_svp.h \
 	art_rgb.h \
-	art_rgb_a_affine.h \
 	art_rgb_affine.h \
 	art_rgb_affine_private.h \
-	art_rgb_bitmap_affine.h \
-	art_rgb_pixbuf_affine.h \
 	art_rgb_rgba_affine.h \
 	art_rgb_svp.h \
-	art_rgba.h \
 	art_svp.h \
 	art_svp_intersect.h \
 	art_svp_ops.h \
@@ -42,7 +35,6 @@ libart_lgplinclude_HEADERS = \
 	art_svp_vpath_stroke.h \
 	art_svp_wind.h \
 	art_uta.h \
-	art_uta_ops.h \
 	art_uta_rect.h \
 	art_uta_svp.h \
 	art_uta_vpath.h \
@@ -54,7 +46,6 @@ libart_lgplinclude_HEADERS = \
 
 libart_lgpl_la_SOURCES = \
 	art_affine.c \
-	art_alphagamma.c \
 	art_bpath.c \
 	art_gray_svp.c \
 	art_misc.c \
@@ -63,18 +54,11 @@ libart_lgpl_la_SOURCES = \
 	art_rect_svp.c \
 	art_rect_uta.c \
 	art_render.c \
-	art_render_gradient.c \
-	art_render_mask.c \
-	art_render_svp.c \
 	art_rgb.c \
-	art_rgb_a_affine.c \
 	art_rgb_affine.c \
 	art_rgb_affine_private.c \
-	art_rgb_bitmap_affine.c \
-	art_rgb_pixbuf_affine.c \
 	art_rgb_rgba_affine.c \
 	art_rgb_svp.c \
-	art_rgba.c \
 	art_svp.c \
 	art_svp_intersect.c \
 	art_svp_ops.c \
@@ -82,9 +66,7 @@ libart_lgpl_la_SOURCES = \
 	art_svp_render_aa.c \
 	art_svp_vpath.c \
 	art_svp_vpath_stroke.c \
-	art_svp_wind.c \
 	art_uta.c \
-	art_uta_ops.c \
 	art_uta_rect.c \
 	art_uta_svp.c \
 	art_uta_vpath.c \
diff --git a/libart_lgpl/art_affine.c b/libart_lgpl/art_affine.c
index 9f332a3..96007d0 100644
--- a/libart_lgpl/art_affine.c
+++ b/libart_lgpl/art_affine.c
@@ -77,29 +77,6 @@ art_affine_invert (double dst[6], const double src[6])
   dst[5] = -src[4] * dst[1] - src[5] * dst[3];
 }
 
-/**
- * art_affine_flip: Flip an affine transformation horizontally and/or vertically.
- * @dst_affine: Where the resulting affine is stored.
- * @src_affine: The original affine transformation.
- * @horiz: Whether or not to flip horizontally.
- * @vert: Whether or not to flip horizontally.
- *
- * Flips the affine transform. FALSE for both @horiz and @vert implements
- * a simple copy operation. TRUE for both @horiz and @vert is a
- * 180 degree rotation. It is ok for @src_affine and @dst_affine to
- * be equal pointers.
- **/
-void
-art_affine_flip (double dst_affine[6], const double src_affine[6], int horz, int vert)
-{
-  dst_affine[0] = horz ? - src_affine[0] : src_affine[0];
-  dst_affine[1] = horz ? - src_affine[1] : src_affine[1];
-  dst_affine[2] = vert ? - src_affine[2] : src_affine[2];
-  dst_affine[3] = vert ? - src_affine[3] : src_affine[3];
-  dst_affine[4] = horz ? - src_affine[4] : src_affine[4];
-  dst_affine[5] = vert ? - src_affine[5] : src_affine[5];
-}
-
 #define EPSILON 1e-6
 
 /* It's ridiculous I have to write this myself. This is hardcoded to
@@ -335,55 +312,6 @@ art_affine_scale (double dst[6], double sx, double sy)
 }
 
 /**
- * art_affine_rotate: Set up a rotation affine transform.
- * @dst: Where to store the resulting affine transform.
- * @theta: Rotation angle in degrees.
- *
- * Sets up a rotation matrix. In the standard libart coordinate
- * system, in which increasing y moves downward, this is a
- * counterclockwise rotation. In the standard PostScript coordinate
- * system, which is reversed in the y direction, it is a clockwise
- * rotation.
- **/
-void
-art_affine_rotate (double dst[6], double theta)
-{
-  double s, c;
-
-  s = sin (theta * M_PI / 180.0);
-  c = cos (theta * M_PI / 180.0);
-  dst[0] = c;
-  dst[1] = s;
-  dst[2] = -s;
-  dst[3] = c;
-  dst[4] = 0;
-  dst[5] = 0;
-}
-
-/**
- * art_affine_shear: Set up a shearing matrix.
- * @dst: Where to store the resulting affine transform.
- * @theta: Shear angle in degrees.
- *
- * Sets up a shearing matrix. In the standard libart coordinate system
- * and a small value for theta, || becomes \\. Horizontal lines remain
- * unchanged.
- **/
-void
-art_affine_shear (double dst[6], double theta)
-{
-  double t;
-
-  t = tan (theta * M_PI / 180.0);
-  dst[0] = 1;
-  dst[1] = 0;
-  dst[2] = t;
-  dst[3] = 1;
-  dst[4] = 0;
-  dst[5] = 0;
-}
-
-/**
  * art_affine_translate: Set up a translation matrix.
  * @dst: Where to store the resulting affine transform.
  * @tx: X translation amount.
@@ -419,40 +347,3 @@ art_affine_expansion (const double src[6])
   return sqrt (fabs (src[0] * src[3] - src[1] * src[2]));
 }
 
-/**
- * art_affine_rectilinear: Determine whether the affine transformation is rectilinear.
- * @src: The original affine transformation.
- *
- * Determines whether @src is rectilinear, i.e.  grid-aligned
- * rectangles are transformed to other grid-aligned rectangles.  The
- * implementation has epsilon-tolerance for roundoff errors.
- *
- * Return value: TRUE if @src is rectilinear.
- **/
-int
-art_affine_rectilinear (const double src[6])
-{
-  return ((fabs (src[1]) < EPSILON && fabs (src[2]) < EPSILON) ||
-	  (fabs (src[0]) < EPSILON && fabs (src[3]) < EPSILON));
-}
-
-/**
- * art_affine_equal: Determine whether two affine transformations are equal.
- * @matrix1: An affine transformation.
- * @matrix2: Another affine transformation.
- *
- * Determines whether @matrix1 and @matrix2 are equal, with
- * epsilon-tolerance for roundoff errors.
- *
- * Return value: TRUE if @matrix1 and @matrix2 are equal.
- **/
-int
-art_affine_equal (double matrix1[6], double matrix2[6])
-{
-  return (fabs (matrix1[0] - matrix2[0]) < EPSILON &&
-	  fabs (matrix1[1] - matrix2[1]) < EPSILON &&
-	  fabs (matrix1[2] - matrix2[2]) < EPSILON &&
-	  fabs (matrix1[3] - matrix2[3]) < EPSILON &&
-	  fabs (matrix1[4] - matrix2[4]) < EPSILON &&
-	  fabs (matrix1[5] - matrix2[5]) < EPSILON);
-}
diff --git a/libart_lgpl/art_affine.h b/libart_lgpl/art_affine.h
index 0baee70..83f64b9 100644
--- a/libart_lgpl/art_affine.h
+++ b/libart_lgpl/art_affine.h
@@ -33,12 +33,6 @@ art_affine_point (ArtPoint *dst, const ArtPoint *src,
 void
 art_affine_invert (double dst_affine[6], const double src_affine[6]);
 
-/* flip the matrix, FALSE, FALSE is a simple copy operation, and
-   TRUE, TRUE equals a rotation by 180 degrees */
-void
-art_affine_flip (double dst_affine[6], const double src_affine[6],
-                 int horz, int vert);
-
 void
 art_affine_to_string (char str[128], const double src[6]);
 
@@ -54,14 +48,6 @@ art_affine_identity (double dst[6]);
 void
 art_affine_scale (double dst[6], double sx, double sy);
 
-/* set up a rotation matrix; theta is given in degrees */
-void
-art_affine_rotate (double dst[6], double theta);
-
-/* set up a shearing matrix; theta is given in degrees */
-void
-art_affine_shear (double dst[6], double theta);
-
 /* set up a translation matrix */
 void
 art_affine_translate (double dst[6], double tx, double ty);
@@ -71,16 +57,6 @@ art_affine_translate (double dst[6], double tx, double ty);
 double
 art_affine_expansion (const double src[6]);
 
-/* Determine whether the affine transformation is rectilinear,
-   i.e. whether a rectangle aligned to the grid is transformed into
-   another rectangle aligned to the grid. */
-int
-art_affine_rectilinear (const double src[6]);
-
-/* Determine whether two affine transformations are equal within grid allignment */
-int
-art_affine_equal (double matrix1[6], double matrix2[6]);
-
 
 #ifdef __cplusplus
 }
diff --git a/libart_lgpl/art_alphagamma.h b/libart_lgpl/art_alphagamma.h
index 5f766c9..f3ee357 100644
--- a/libart_lgpl/art_alphagamma.h
+++ b/libart_lgpl/art_alphagamma.h
@@ -38,12 +38,6 @@ struct _ArtAlphaGamma {
   art_u8 invtable[1];
 };
 
-ArtAlphaGamma *
-art_alphagamma_new (double gamma);
-
-void
-art_alphagamma_free (ArtAlphaGamma *alphagamma);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/libart_lgpl/art_pixbuf.c b/libart_lgpl/art_pixbuf.c
index e993753..c624c7d 100644
--- a/libart_lgpl/art_pixbuf.c
+++ b/libart_lgpl/art_pixbuf.c
@@ -111,175 +111,3 @@ art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstrid
   return pixbuf;
 }
 
-/**
- * art_pixbuf_new_const_rgb: Create a new RGB #ArtPixBuf with constant pixel data.
- * @pixels: A buffer containing the actual pixel data.
- * @width: The width of the pixbuf.
- * @height: The height of the pixbuf.
- * @rowstride: The rowstride of the pixbuf.
- *
- * Creates a generic data structure for holding a buffer of RGB
- * pixels.  It is possible to think of an #ArtPixBuf as a
- * virtualization over specific pixel buffer formats.
- *
- * No action is taken when the #ArtPixBuf is destroyed. Thus, this
- * function is useful when the pixel data is constant or statically
- * allocated.
- *
- * Return value: The newly created #ArtPixBuf.
- **/
-ArtPixBuf *
-art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride)
-{
-  return art_pixbuf_new_rgb_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL);
-}
-
-/**
- * art_pixbuf_new_const_rgba: Create a new RGBA #ArtPixBuf with constant pixel data.
- * @pixels: A buffer containing the actual pixel data.
- * @width: The width of the pixbuf.
- * @height: The height of the pixbuf.
- * @rowstride: The rowstride of the pixbuf.
- *
- * Creates a generic data structure for holding a buffer of RGBA
- * pixels.  It is possible to think of an #ArtPixBuf as a
- * virtualization over specific pixel buffer formats.
- *
- * No action is taken when the #ArtPixBuf is destroyed. Thus, this
- * function is suitable when the pixel data is constant or statically
- * allocated.
- *
- * Return value: The newly created #ArtPixBuf.
- **/
-ArtPixBuf *
-art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride)
-{
-  return art_pixbuf_new_rgba_dnotify ((art_u8 *) pixels, width, height, rowstride, NULL, NULL);
-}
-
-static void
-art_pixel_destroy (void *func_data, void *data)
-{
-  art_free (data);
-}
-
-/**
- * art_pixbuf_new_rgb: Create a new RGB #ArtPixBuf.
- * @pixels: A buffer containing the actual pixel data.
- * @width: The width of the pixbuf.
- * @height: The height of the pixbuf.
- * @rowstride: The rowstride of the pixbuf.
- *
- * Creates a generic data structure for holding a buffer of RGB
- * pixels.  It is possible to think of an #ArtPixBuf as a
- * virtualization over specific pixel buffer formats.
- *
- * The @pixels buffer is freed with art_free() when the #ArtPixBuf is
- * destroyed. Thus, this function is suitable when the pixel data is
- * allocated with art_alloc().
- *
- * Return value: The newly created #ArtPixBuf.
- **/
-ArtPixBuf *
-art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride)
-{
-  return art_pixbuf_new_rgb_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy);
-}
-
-/**
- * art_pixbuf_new_rgba: Create a new RGBA #ArtPixBuf.
- * @pixels: A buffer containing the actual pixel data.
- * @width: The width of the pixbuf.
- * @height: The height of the pixbuf.
- * @rowstride: The rowstride of the pixbuf.
- *
- * Creates a generic data structure for holding a buffer of RGBA
- * pixels.  It is possible to think of an #ArtPixBuf as a
- * virtualization over specific pixel buffer formats.
- *
- * The @pixels buffer is freed with art_free() when the #ArtPixBuf is
- * destroyed. Thus, this function is suitable when the pixel data is
- * allocated with art_alloc().
- *
- * Return value: The newly created #ArtPixBuf.
- **/
-ArtPixBuf *
-art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride)
-{
-  return art_pixbuf_new_rgba_dnotify (pixels, width, height, rowstride, NULL, art_pixel_destroy);
-}
-
-/**
- * art_pixbuf_free: Destroy an #ArtPixBuf.
- * @pixbuf: The #ArtPixBuf to be destroyed.
- *
- * Destroys the #ArtPixBuf, calling the destroy notification function
- * (if non-NULL) so that the memory for the pixel buffer can be
- * properly reclaimed.
- **/
-void
-art_pixbuf_free (ArtPixBuf *pixbuf)
-{
-  ArtDestroyNotify destroy = pixbuf->destroy;
-  void *destroy_data = pixbuf->destroy_data;
-  art_u8 *pixels = pixbuf->pixels;
-
-  pixbuf->pixels = NULL;
-  pixbuf->destroy = NULL;
-  pixbuf->destroy_data = NULL;
-
-  if (destroy)
-    destroy (destroy_data, pixels);
-
-  art_free (pixbuf);
-}
-
-/**
- * art_pixbuf_free_shallow:
- * @pixbuf: The #ArtPixBuf to be destroyed.
- *
- * Destroys the #ArtPixBuf without calling the destroy notification function.
- *
- * This function is deprecated. Use the _dnotify variants for
- * allocation instead.
- **/
-void
-art_pixbuf_free_shallow (ArtPixBuf *pixbuf)
-{
-  art_free (pixbuf);
-}
-
-/**
- * art_pixbuf_duplicate: Duplicate a pixbuf.
- * @pixbuf: The #ArtPixBuf to duplicate.
- *
- * Duplicates a pixbuf, including duplicating the buffer.
- *
- * Return value: The duplicated pixbuf.
- **/
-ArtPixBuf *
-art_pixbuf_duplicate (const ArtPixBuf *pixbuf)
-{
-  ArtPixBuf *result;
-  int size;
-
-  result = art_new (ArtPixBuf, 1);
-
-  result->format = pixbuf->format;
-  result->n_channels = pixbuf->n_channels;
-  result->has_alpha = pixbuf->has_alpha;
-  result->bits_per_sample = pixbuf->bits_per_sample;
-
-  size = (pixbuf->height - 1) * pixbuf->rowstride +
-    pixbuf->width * ((pixbuf->n_channels * pixbuf->bits_per_sample + 7) >> 3);
-  result->pixels = art_alloc (size);
-  memcpy (result->pixels, pixbuf->pixels, size);
-
-  result->width = pixbuf->width;
-  result->height = pixbuf->height;
-  result->rowstride = pixbuf->rowstride;
-  result->destroy_data = NULL;
-  result->destroy = art_pixel_destroy;
-
-  return result;
-}
diff --git a/libart_lgpl/art_pixbuf.h b/libart_lgpl/art_pixbuf.h
index 31f5620..6d79f5d 100644
--- a/libart_lgpl/art_pixbuf.h
+++ b/libart_lgpl/art_pixbuf.h
@@ -59,20 +59,6 @@ struct _ArtPixBuf {
   ArtDestroyNotify destroy;
 };
 
-/* allocate an ArtPixBuf from art_alloc()ed pixels (automated destruction) */
-ArtPixBuf *
-art_pixbuf_new_rgb (art_u8 *pixels, int width, int height, int rowstride);
-
-ArtPixBuf *
-art_pixbuf_new_rgba (art_u8 *pixels, int width, int height, int rowstride);
-
-/* allocate an ArtPixBuf from constant pixels (no destruction) */
-ArtPixBuf *
-art_pixbuf_new_const_rgb (const art_u8 *pixels, int width, int height, int rowstride);
-
-ArtPixBuf *
-art_pixbuf_new_const_rgba (const art_u8 *pixels, int width, int height, int rowstride);
-
 /* allocate an ArtPixBuf and notify creator upon destruction */
 ArtPixBuf *
 art_pixbuf_new_rgb_dnotify (art_u8 *pixels, int width, int height, int rowstride,
@@ -82,17 +68,6 @@ ArtPixBuf *
 art_pixbuf_new_rgba_dnotify (art_u8 *pixels, int width, int height, int rowstride,
 			     void *dfunc_data, ArtDestroyNotify dfunc);
 
-/* free an ArtPixBuf with destroy notification */
-void
-art_pixbuf_free (ArtPixBuf *pixbuf);
-
-/* deprecated function, use the _dnotify variants for allocation instead */
-void
-art_pixbuf_free_shallow (ArtPixBuf *pixbuf);
-
-ArtPixBuf *
-art_pixbuf_duplicate (const ArtPixBuf *pixbuf);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/libart_lgpl/art_rect.c b/libart_lgpl/art_rect.c
index c9dd5b3..6d318a8 100644
--- a/libart_lgpl/art_rect.c
+++ b/libart_lgpl/art_rect.c
@@ -48,28 +48,6 @@ art_irect_copy (ArtIRect *dest, const ArtIRect *src) {
 }
 
 /**
- * art_irect_union: Find union of two integer rectangles.
- * @dest: Where the result is stored.
- * @src1: A source rectangle.
- * @src2: Another source rectangle.
- *
- * Finds the smallest rectangle that includes @src1 and @src2.
- **/
-void
-art_irect_union (ArtIRect *dest, const ArtIRect *src1, const ArtIRect *src2) {
-  if (art_irect_empty (src1)) {
-    art_irect_copy (dest, src2);
-  } else if (art_irect_empty (src2)) {
-    art_irect_copy (dest, src1);
-  } else {
-    dest->x0 = MIN (src1->x0, src2->x0);
-    dest->y0 = MIN (src1->y0, src2->y0);
-    dest->x1 = MAX (src1->x1, src2->x1);
-    dest->y1 = MAX (src1->y1, src2->y1);
-  }
-}
-
-/**
  * art_irect_intersection: Find intersection of two integer rectangles.
  * @dest: Where the result is stored.
  * @src1: A source rectangle.
@@ -141,22 +119,6 @@ art_drect_union (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) {
 }
 
 /**
- * art_drect_intersection: Find intersection of two rectangles.
- * @dest: Where the result is stored.
- * @src1: A source rectangle.
- * @src2: Another source rectangle.
- *
- * Finds the intersection of @src1 and @src2.
- **/
-void
-art_drect_intersect (ArtDRect *dest, const ArtDRect *src1, const ArtDRect *src2) {
-  dest->x0 = MAX (src1->x0, src2->x0);
-  dest->y0 = MAX (src1->y0, src2->y0);
-  dest->x1 = MIN (src1->x1, src2->x1);
-  dest->y1 = MIN (src1->y1, src2->y1);
-}
-
-/**
  * art_irect_empty: Determine whether rectangle is empty.
  * @src: The source rectangle.
  *
diff --git a/libart_lgpl/art_rect.h b/libart_lgpl/art_rect.h
index 088079f..247cbea 100644
--- a/libart_lgpl/art_rect.h
+++ b/libart_lgpl/art_rect.h
@@ -40,10 +40,6 @@ struct _ArtIRect {
 /* Make a copy of the rectangle. */
 void art_irect_copy (ArtIRect *dest, const ArtIRect *src);
 
-/* Find the smallest rectangle that includes both source rectangles. */
-void art_irect_union (ArtIRect *dest,
-		      const ArtIRect *src1, const ArtIRect *src2);
-
 /* Return the intersection of the two rectangles */
 void art_irect_intersect (ArtIRect *dest,
 			  const ArtIRect *src1, const ArtIRect *src2);
@@ -58,10 +54,6 @@ void art_drect_copy (ArtDRect *dest, const ArtDRect *src);
 void art_drect_union (ArtDRect *dest,
 		      const ArtDRect *src1, const ArtDRect *src2);
 
-/* Return the intersection of the two rectangles */
-void art_drect_intersect (ArtDRect *dest,
-			  const ArtDRect *src1, const ArtDRect *src2);
-
 /* Return true if the rectangle is empty. */
 int art_drect_empty (const ArtDRect *src);
 
diff --git a/libart_lgpl/art_render.c b/libart_lgpl/art_render.c
index 65b344c..771f15f 100644
--- a/libart_lgpl/art_render.c
+++ b/libart_lgpl/art_render.c
@@ -39,115 +39,10 @@ struct _ArtRenderPriv {
   ArtRenderCallback **callbacks;
 };
 
-ArtRender *
-art_render_new (int x0, int y0, int x1, int y1,
-		art_u8 *pixels, int rowstride,
-		int n_chan, int depth, ArtAlphaType alpha_type,
-		ArtAlphaGamma *alphagamma)
-{
-  ArtRenderPriv *priv;
-  ArtRender *result;
-
-  priv = art_new (ArtRenderPriv, 1);
-  result = &priv->super;
-
-  if (n_chan > ART_MAX_CHAN)
-    {
-      art_warn ("art_render_new: n_chan = %d, exceeds %d max\n",
-		n_chan, ART_MAX_CHAN);
-      return NULL;
-    }
-  if (depth > ART_MAX_DEPTH)
-    {
-      art_warn ("art_render_new: depth = %d, exceeds %d max\n",
-		depth, ART_MAX_DEPTH);
-      return NULL;
-    }
-  if (x0 >= x1)
-    {
-      art_warn ("art_render_new: x0 >= x1 (x0 = %d, x1 = %d)\n", x0, x1);
-      return NULL;
-    }
-  result->x0 = x0;
-  result->y0 = y0;
-  result->x1 = x1;
-  result->y1 = y1;
-  result->pixels = pixels;
-  result->rowstride = rowstride;
-  result->n_chan = n_chan;
-  result->depth = depth;
-  result->alpha_type = alpha_type;
-
-  result->clear = ART_FALSE;
-  result->opacity = 0x10000;
-  result->compositing_mode = ART_COMPOSITE_NORMAL;
-  result->alphagamma = alphagamma;
-
-  result->alpha_buf = NULL;
-  result->image_buf = NULL;
-
-  result->run = NULL;
-  result->span_x = NULL;
-
-  result->need_span = ART_FALSE;
-
-  priv->image_source = NULL;
-
-  priv->n_mask_source = 0;
-  priv->mask_source = NULL;
-
-  return result;
-}
-
 /* todo on clear routines: I haven't really figured out what to do
    with clearing the alpha channel. It _should_ be possible to clear
    to an arbitrary RGBA color. */
 
-/**
- * art_render_clear: Set clear color.
- * @clear_color: Color with which to clear dest.
- *
- * Sets clear color, equivalent to actually clearing the destination
- * buffer before rendering. This is the most general form.
- **/
-void
-art_render_clear (ArtRender *render, const ArtPixMaxDepth *clear_color)
-{
-  int i;
-  int n_ch = render->n_chan + (render->alpha_type != ART_ALPHA_NONE);
-
-  render->clear = ART_TRUE;
-  for (i = 0; i < n_ch; i++)
-    render->clear_color[i] = clear_color[i];
-}
-
-/**
- * art_render_clear_rgb: Set clear color, given in RGB format.
- * @clear_rgb: Clear color, in 0xRRGGBB format.
- *
- * Sets clear color, equivalent to actually clearing the destination
- * buffer before rendering.
- **/
-void
-art_render_clear_rgb (ArtRender *render, art_u32 clear_rgb)
-{
-  if (render->n_chan != 3)
-    art_warn ("art_render_clear_rgb: called on render with %d channels, only works with 3\n",
-	      render->n_chan);
-  else
-    {
-      int r, g, b;
-
-      render->clear = ART_TRUE;
-      r = clear_rgb >> 16;
-      g = (clear_rgb >> 8) & 0xff;
-      b = clear_rgb & 0xff;
-      render->clear_color[0] = ART_PIX_MAX_FROM_8(r);
-      render->clear_color[1] = ART_PIX_MAX_FROM_8(g);
-      render->clear_color[2] = ART_PIX_MAX_FROM_8(b);
-    }
-}
-
 static void
 art_render_nop_done (ArtRenderCallback *self, ArtRender *render)
 {
@@ -238,43 +133,6 @@ const ArtRenderCallback art_render_clear_16_obj =
 
 #endif /* ART_MAX_DEPTH >= 16 */
 
-/* todo: inline */
-static ArtRenderCallback *
-art_render_choose_clear_callback (ArtRender *render)
-{
-  ArtRenderCallback *clear_callback;
-
-  if (render->depth == 8)
-    {
-      if (render->n_chan == 3 &&
-	  render->alpha_type == ART_ALPHA_NONE)
-	clear_callback = (ArtRenderCallback *)&art_render_clear_rgb8_obj;
-      else
-	clear_callback = (ArtRenderCallback *)&art_render_clear_8_obj;
-    }
-#if ART_MAX_DEPTH >= 16
-  else if (render->depth == 16)
-    clear_callback = (ArtRenderCallback *)&art_render_clear_16_obj;
-#endif
-  else
-    {
-      art_die ("art_render_choose_clear_callback: inconsistent render->depth = %d\n",
-	       render->depth);
-    }
-  return clear_callback;
-}
-
-#if 0
-/* todo: get around to writing this */
-static void
-art_render_composite_render_noa_8_norm (ArtRenderCallback *self, ArtRender *render,
-					art_u8 *dest, int y)
-{
-  int width = render->x1 - render->x0;
-
-}
-#endif
-
 /* This is the most general form of the function. It is slow but
    (hopefully) correct. Actually, I'm still worried about roundoff
    errors in the premul case - it seems to me that an off-by-one could
@@ -882,27 +740,6 @@ const ArtRenderCallback art_render_composite_8_opt2_obj =
 };
 
 
-/* todo: inline */
-static ArtRenderCallback *
-art_render_choose_compositing_callback (ArtRender *render)
-{
-  if (render->depth == 8 && render->buf_depth == 8)
-    {
-      if (render->n_chan == 3 &&
-	  render->alpha_buf == NULL &&
-	  render->alpha_type == ART_ALPHA_SEPARATE)
-	{
-	  if (render->buf_alpha == ART_ALPHA_NONE)
-	    return (ArtRenderCallback *)&art_render_composite_8_opt1_obj;
-	  else if (render->buf_alpha == ART_ALPHA_PREMUL)
-	    return (ArtRenderCallback *)&art_render_composite_8_opt2_obj;
-	}
-	  
-      return (ArtRenderCallback *)&art_render_composite_8_obj;
-    }
-  return (ArtRenderCallback *)&art_render_composite_obj;
-}
-
 /**
  * art_render_invoke_callbacks: Invoke the callbacks in the render object.
  * @render: The render object.
@@ -930,184 +767,6 @@ art_render_invoke_callbacks (ArtRender *render, art_u8 *dest, int y)
 }
 
 /**
- * art_render_invoke: Perform the requested rendering task.
- * @render: The render object.
- *
- * Invokes the renderer and all sources associated with it, to perform
- * the requested rendering task.
- **/
-void
-art_render_invoke (ArtRender *render)
-{
-  ArtRenderPriv *priv = (ArtRenderPriv *)render;
-  int width;
-  int best_driver, best_score;
-  int i;
-  int n_callbacks, n_callbacks_max;
-  ArtImageSource *image_source;
-  ArtImageSourceFlags image_flags;
-  int buf_depth;
-  ArtAlphaType buf_alpha;
-  art_boolean first = ART_TRUE;
-
-  if (render == NULL)
-    {
-      art_warn ("art_render_invoke: called with render == NULL\n");
-      return;
-    }
-  if (priv->image_source == NULL)
-    {
-      art_warn ("art_render_invoke: no image source given\n");
-      return;
-    }
-
-  width = render->x1 - render->x0;
-
-  render->run = art_new (ArtRenderMaskRun, width + 1);
-
-  /* Elect a mask source as driver. */
-  best_driver = -1;
-  best_score = 0;
-  for (i = 0; i < priv->n_mask_source; i++)
-    {
-      int score;
-      ArtMaskSource *mask_source;
-
-      mask_source = priv->mask_source[i];
-      score = mask_source->can_drive (mask_source, render);
-      if (score > best_score)
-	{
-	  best_score = score;
-	  best_driver = i;
-	}
-    }
-
-  /* Allocate alpha buffer if needed. */
-  if (priv->n_mask_source > 1 ||
-      (priv->n_mask_source == 1 && best_driver < 0))
-    {
-      render->alpha_buf = art_new (art_u8, (width * render->depth) >> 3);
-    }
-
-  /* Negotiate image rendering and compositing. */
-  image_source = priv->image_source;
-  image_source->negotiate (image_source, render, &image_flags, &buf_depth,
-			   &buf_alpha);
-
-  /* Build callback list. */
-  n_callbacks_max = priv->n_mask_source + 3;
-  priv->callbacks = art_new (ArtRenderCallback *, n_callbacks_max);
-  n_callbacks = 0;
-  for (i = 0; i < priv->n_mask_source; i++)
-    if (i != best_driver)
-      {
-	ArtMaskSource *mask_source = priv->mask_source[i];
-
-	mask_source->prepare (mask_source, render, first);
-	first = ART_FALSE;
-	priv->callbacks[n_callbacks++] = &mask_source->super;
-      }
-
-  if (render->clear && !(image_flags & ART_IMAGE_SOURCE_CAN_CLEAR))
-    priv->callbacks[n_callbacks++] =
-      art_render_choose_clear_callback (render);
-
-  priv->callbacks[n_callbacks++] = &image_source->super;
-
-  /* Allocate image buffer and add compositing callback if needed. */
-  if (!(image_flags & ART_IMAGE_SOURCE_CAN_COMPOSITE))
-    {
-      int bytespp = ((render->n_chan + (buf_alpha != ART_ALPHA_NONE)) *
-		     buf_depth) >> 3;
-      render->buf_depth = buf_depth;
-      render->buf_alpha = buf_alpha;
-      render->image_buf = art_new (art_u8, width * bytespp);
-      priv->callbacks[n_callbacks++] =
-	art_render_choose_compositing_callback (render);
-    }
-
-  priv->n_callbacks = n_callbacks;
-
-  if (render->need_span)
-    render->span_x = art_new (int, width + 1);
-
-  /* Invoke the driver */
-  if (best_driver >= 0)
-    {
-      ArtMaskSource *driver;
-
-      driver = priv->mask_source[best_driver];
-      driver->invoke_driver (driver, render);
-    }
-  else
-    {
-      art_u8 *dest_ptr = render->pixels;
-      int y;
-
-      /* Dummy driver */
-      render->n_run = 2;
-      render->run[0].x = render->x0;
-      render->run[0].alpha = 0x8000 + 0xff * render->opacity;
-      render->run[1].x = render->x1;
-      render->run[1].alpha = 0x8000;
-      if (render->need_span)
-	{
-	  render->n_span = 2;
-	  render->span_x[0] = render->x0;
-	  render->span_x[1] = render->x1;
-	}
-      for (y = render->y0; y < render->y1; y++)
-	{
-	  art_render_invoke_callbacks (render, dest_ptr, y);
-	  dest_ptr += render->rowstride;
-	}
-    }
-
-  if (priv->mask_source != NULL)
-    art_free (priv->mask_source);
-
-  /* clean up callbacks */
-  for (i = 0; i < priv->n_callbacks; i++)
-    {
-      ArtRenderCallback *callback;
-
-      callback = priv->callbacks[i];
-      callback->done (callback, render);
-    }
-
-  /* Tear down object */
-  if (render->alpha_buf != NULL)
-    art_free (render->alpha_buf);
-  if (render->image_buf != NULL)
-    art_free (render->image_buf);
-  art_free (render->run);
-  if (render->span_x != NULL)
-    art_free (render->span_x);
-  art_free (priv->callbacks);
-  art_free (render);
-}
-
-/**
- * art_render_mask_solid: Add a solid translucent mask.
- * @render: The render object.
- * @opacity: Opacity in [0..0x10000] form.
- *
- * Adds a translucent mask to the rendering object.
- **/
-void
-art_render_mask_solid (ArtRender *render, int opacity)
-{
-  art_u32 old_opacity = render->opacity;
-  art_u32 new_opacity_tmp;
-
-  if (opacity == 0x10000)
-    /* avoid potential overflow */
-    return;
-  new_opacity_tmp = old_opacity * (art_u32)opacity + 0x8000;
-  render->opacity = new_opacity_tmp >> 16;
-}
-
-/**
  * art_render_add_mask_source: Add a mask source to the render object.
  * @render: Render object.
  * @mask_source: Mask source to add.
@@ -1170,214 +829,3 @@ struct _ArtImageSourceSolid {
   art_boolean init;
 };
 
-static void
-art_render_image_solid_done (ArtRenderCallback *self, ArtRender *render)
-{
-  ArtImageSourceSolid *z = (ArtImageSourceSolid *)self;
-
-  if (z->rgbtab != NULL)
-    art_free (z->rgbtab);
-  art_free (self);
-}
-
-static void
-art_render_image_solid_rgb8_opaq_init (ArtImageSourceSolid *self, ArtRender *render)
-{
-  ArtImageSourceSolid *z = (ArtImageSourceSolid *)self;
-  ArtPixMaxDepth color_max;
-  int r_fg, g_fg, b_fg;
-  int r_bg, g_bg, b_bg;
-  int r, g, b;
-  int dr, dg, db;
-  int i;
-  int tmp;
-  art_u32 *rgbtab;
-
-  rgbtab = art_new (art_u32, 256);
-  z->rgbtab = rgbtab;
-
-  color_max = self->color[0];
-  r_fg = ART_PIX_8_FROM_MAX (color_max);
-  color_max = self->color[1];
-  g_fg = ART_PIX_8_FROM_MAX (color_max);
-  color_max = self->color[2];
-  b_fg = ART_PIX_8_FROM_MAX (color_max);
-
-  color_max = render->clear_color[0];
-  r_bg = ART_PIX_8_FROM_MAX (color_max);
-  color_max = render->clear_color[1];
-  g_bg = ART_PIX_8_FROM_MAX (color_max);
-  color_max = render->clear_color[2];
-  b_bg = ART_PIX_8_FROM_MAX (color_max);
-
-  r = (r_bg << 16) + 0x8000;
-  g = (g_bg << 16) + 0x8000;
-  b = (b_bg << 16) + 0x8000;
-  tmp = ((r_fg - r_bg) << 16) + 0x80;
-  dr = (tmp + (tmp >> 8)) >> 8;
-  tmp = ((g_fg - g_bg) << 16) + 0x80;
-  dg = (tmp + (tmp >> 8)) >> 8;
-  tmp = ((b_fg - b_bg) << 16) + 0x80;
-  db = (tmp + (tmp >> 8)) >> 8;
-
-  for (i = 0; i < 256; i++)
-    {
-      rgbtab[i] = (r & 0xff0000) | ((g & 0xff0000) >> 8) | (b >> 16);
-      r += dr;
-      g += dg;
-      b += db;
-    }
-}
-
-static void
-art_render_image_solid_rgb8_opaq (ArtRenderCallback *self, ArtRender *render,
-				  art_u8 *dest, int y)
-{
-  ArtImageSourceSolid *z = (ArtImageSourceSolid *)self;
-  ArtRenderMaskRun *run = render->run;
-  int n_run = render->n_run;
-  art_u32 *rgbtab = z->rgbtab;
-  art_u32 rgb;
-  int x0 = render->x0;
-  int x1 = render->x1;
-  int run_x0, run_x1;
-  int i;
-  int ix;
-
-  if (n_run > 0)
-    {
-      run_x1 = run[0].x;
-      if (run_x1 > x0)
-	{
-	  rgb = rgbtab[0];
-	  art_rgb_fill_run (dest,
-			    rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff,
-			    run_x1 - x0);
-	}
-      for (i = 0; i < n_run - 1; i++)
-	{
-	  run_x0 = run_x1;
-	  run_x1 = run[i + 1].x;
-	  rgb = rgbtab[(run[i].alpha >> 16) & 0xff];
-	  ix = (run_x0 - x0) * 3;
-#define OPTIMIZE_LEN_1
-#ifdef OPTIMIZE_LEN_1
-	  if (run_x1 - run_x0 == 1)
-	    {
-	      dest[ix] = rgb >> 16;
-	      dest[ix + 1] = (rgb >> 8) & 0xff;
-	      dest[ix + 2] = rgb & 0xff;
-	    }
-	  else
-	    {
-	      art_rgb_fill_run (dest + ix,
-				rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff,
-				run_x1 - run_x0);
-	    }
-#else
-	  art_rgb_fill_run (dest + ix,
-			    rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff,
-			    run_x1 - run_x0);
-#endif
-	}
-    }
-  else
-    {
-      run_x1 = x0;
-    }
-  if (run_x1 < x1)
-    {
-      rgb = rgbtab[0];
-      art_rgb_fill_run (dest + (run_x1 - x0) * 3,
-			rgb >> 16, (rgb >> 8) & 0xff, rgb & 0xff,
-			x1 - run_x1);
-    }
-}
-
-static void
-art_render_image_solid_rgb8 (ArtRenderCallback *self, ArtRender *render,
-			     art_u8 *dest, int y)
-{
-  ArtImageSourceSolid *z = (ArtImageSourceSolid *)self;
-  int width = render->x1 - render->x0;
-  art_u8 r, g, b;
-  ArtPixMaxDepth color_max;
-
-  /* todo: replace this simple test with real sparseness */
-  if (z->init)
-    return;
-  z->init = ART_TRUE;
-
-  color_max = z->color[0];
-  r = ART_PIX_8_FROM_MAX (color_max);
-  color_max = z->color[1];
-  g = ART_PIX_8_FROM_MAX (color_max);
-  color_max = z->color[2];
-  b = ART_PIX_8_FROM_MAX (color_max);
-
-  art_rgb_fill_run (render->image_buf, r, g, b, width);
-}
-
-static void
-art_render_image_solid_negotiate (ArtImageSource *self, ArtRender *render,
-				  ArtImageSourceFlags *p_flags,
-				  int *p_buf_depth, ArtAlphaType *p_alpha)
-{
-  ArtImageSourceSolid *z = (ArtImageSourceSolid *)self;
-  ArtImageSourceFlags flags = 0;
-  static void (*render_cbk) (ArtRenderCallback *self, ArtRender *render,
-			     art_u8 *dest, int y);
-
-  render_cbk = NULL;
-
-  if (render->depth == 8 && render->n_chan == 3 &&
-      render->alpha_type == ART_ALPHA_NONE)
-    {
-      if (render->clear)
-	{
-	  render_cbk = art_render_image_solid_rgb8_opaq;
-	  flags |= ART_IMAGE_SOURCE_CAN_CLEAR | ART_IMAGE_SOURCE_CAN_COMPOSITE;
-	  art_render_image_solid_rgb8_opaq_init (z, render);
-	}
-    }
-  if (render_cbk == NULL)
-    {
-      if (render->depth == 8)
-	{
-	  render_cbk = art_render_image_solid_rgb8;
-	  *p_buf_depth = 8;
-	  *p_alpha = ART_ALPHA_NONE; /* todo */
-	}
-    }
-  /* todo: general case */
-  self->super.render = render_cbk;
-  *p_flags = flags;
-}
-
-/**
- * art_render_image_solid: Add a solid color image source.
- * @render: The render object.
- * @color: Color.
- *
- * Adds an image source with the solid color given by @color. The
- * color need not be retained in memory after this call.
- **/
-void
-art_render_image_solid (ArtRender *render, ArtPixMaxDepth *color)
-{
-  ArtImageSourceSolid *image_source;
-  int i;
-
-  image_source = art_new (ArtImageSourceSolid, 1);
-  image_source->super.super.render = NULL;
-  image_source->super.super.done = art_render_image_solid_done;
-  image_source->super.negotiate = art_render_image_solid_negotiate;
-
-  for (i = 0; i < render->n_chan; i++)
-    image_source->color[i] = color[i];
-
-  image_source->rgbtab = NULL;
-  image_source->init = ART_FALSE;
-
-  art_render_add_image_source (render, &image_source->super);
-}
diff --git a/libart_lgpl/art_render.h b/libart_lgpl/art_render.h
index 399033c..db0933e 100644
--- a/libart_lgpl/art_render.h
+++ b/libart_lgpl/art_render.h
@@ -139,27 +139,6 @@ struct _ArtRender {
   art_boolean need_span;
 };
 
-ArtRender *
-art_render_new (int x0, int y0, int x1, int y1,
-		art_u8 *pixels, int rowstride,
-		int n_chan, int depth, ArtAlphaType alpha_type,
-		ArtAlphaGamma *alphagamma);
-
-void
-art_render_invoke (ArtRender *render);
-
-void
-art_render_clear (ArtRender *render, const ArtPixMaxDepth *clear_color);
-
-void
-art_render_clear_rgb (ArtRender *render, art_u32 clear_rgb);
-
-void
-art_render_mask_solid (ArtRender *render, int opacity);
-
-void
-art_render_image_solid (ArtRender *render, ArtPixMaxDepth *color);
-
 /* The next two functions are for custom mask sources only. */
 void
 art_render_add_mask_source (ArtRender *render, ArtMaskSource *mask_source);
diff --git a/libart_lgpl/art_svp_ops.c b/libart_lgpl/art_svp_ops.c
index 5bb837c..08991aa 100644
--- a/libart_lgpl/art_svp_ops.c
+++ b/libart_lgpl/art_svp_ops.c
@@ -183,69 +183,6 @@ art_svp_merge_perturbed (const ArtSVP *svp1, const ArtSVP *svp2)
 }
 #endif
 
-/* Compute the union of two vector paths.
-
-   Status of this routine:
-
-   Basic correctness: Seems to work.
-
-   Numerical stability: We cheat (adding random perturbation). Thus,
-   it seems very likely that no numerical stability problems will be
-   seen in practice.
-
-   Speed: Would be better if we didn't go to unsorted vector path
-   and back to add the perturbation.
-
-   Precision: The perturbation fuzzes the coordinates slightly. In
-   cases of butting segments, razor thin long holes may appear.
-
-*/
-/**
- * art_svp_union: Compute the union of two sorted vector paths.
- * @svp1: One sorted vector path.
- * @svp2: The other sorted vector path.
- *
- * Computes the union of the two argument svp's. Given two svp's with
- * winding numbers of 0 and 1 everywhere, the resulting winding number
- * will be 1 where either (or both) of the argument svp's has a
- * winding number 1, 0 otherwise. The result is newly allocated.
- *
- * Currently, this routine has accuracy problems pending the
- * implementation of the new intersector.
- *
- * Return value: The union of @svp1 and @svp2.
- **/
-ArtSVP *
-art_svp_union (const ArtSVP *svp1, const ArtSVP *svp2)
-{
-#ifdef ART_USE_NEW_INTERSECTOR 
-  ArtSVP *svp3, *svp_new;
-  ArtSvpWriter *swr;
-
-  svp3 = art_svp_merge (svp1, svp2);
-  swr = art_svp_writer_rewind_new (ART_WIND_RULE_POSITIVE);
-  art_svp_intersector (svp3, swr);
-  svp_new = art_svp_writer_rewind_reap (swr);
-  art_free (svp3); /* shallow free because svp3 contains shared segments */
-
-  return svp_new;
-#else
-  ArtSVP *svp3, *svp4, *svp_new;
-
-  svp3 = art_svp_merge_perturbed (svp1, svp2);
-  svp4 = art_svp_uncross (svp3);
-  art_svp_free (svp3);
-
-  svp_new = art_svp_rewind_uncrossed (svp4, ART_WIND_RULE_POSITIVE);
-#ifdef VERBOSE
-  print_ps_svp (svp4);
-  print_ps_svp (svp_new);
-#endif
-  art_svp_free (svp4);
-  return svp_new;
-#endif
-}
-
 /* Compute the intersection of two vector paths.
 
    Status of this routine:
@@ -307,95 +244,3 @@ art_svp_intersect (const ArtSVP *svp1, const ArtSVP *svp2)
 #endif
 }
 
-/* Compute the symmetric difference of two vector paths.
-
-   Status of this routine:
-
-   Basic correctness: Seems to work.
-
-   Numerical stability: We cheat (adding random perturbation). Thus,
-   it seems very likely that no numerical stability problems will be
-   seen in practice.
-
-   Speed: We could do a lot better by scanning through the svp
-   representations and culling out any segments that are exactly
-   identical. It would also be better if we didn't go to unsorted
-   vector path and back to add the perturbation.
-
-   Precision: Awful. In the case of inputs which are similar (the
-   common case for canvas display), the entire outline is "hairy." In
-   addition, the perturbation fuzzes the coordinates slightly. It can
-   be used as a conservative approximation.
-
-*/
-
-/**
- * art_svp_diff: Compute the symmetric difference of two sorted vector paths.
- * @svp1: One sorted vector path.
- * @svp2: The other sorted vector path.
- *
- * Computes the symmetric of the two argument svp's. Given two svp's
- * with winding numbers of 0 and 1 everywhere, the resulting winding
- * number will be 1 where either, but not both, of the argument svp's
- * has a winding number 1, 0 otherwise. The result is newly allocated.
- *
- * Currently, this routine has accuracy problems pending the
- * implementation of the new intersector.
- *
- * Return value: The symmetric difference of @svp1 and @svp2.
- **/
-ArtSVP *
-art_svp_diff (const ArtSVP *svp1, const ArtSVP *svp2)
-{
-#ifdef ART_USE_NEW_INTERSECTOR 
-  ArtSVP *svp3, *svp_new;
-  ArtSvpWriter *swr;
-
-  svp3 = art_svp_merge (svp1, svp2);
-  swr = art_svp_writer_rewind_new (ART_WIND_RULE_ODDEVEN);
-  art_svp_intersector (svp3, swr);
-  svp_new = art_svp_writer_rewind_reap (swr);
-  art_free (svp3); /* shallow free because svp3 contains shared segments */
-
-  return svp_new;
-#else
-  ArtSVP *svp3, *svp4, *svp_new;
-
-  svp3 = art_svp_merge_perturbed (svp1, svp2);
-  svp4 = art_svp_uncross (svp3);
-  art_svp_free (svp3);
-
-  svp_new = art_svp_rewind_uncrossed (svp4, ART_WIND_RULE_ODDEVEN);
-  art_svp_free (svp4);
-  return svp_new;
-#endif
-}
-
-#ifdef ART_USE_NEW_INTERSECTOR 
-ArtSVP *
-art_svp_minus (const ArtSVP *svp1, const ArtSVP *svp2)
-{
-  ArtSVP *svp2_mod;
-  ArtSVP *svp3, *svp_new;
-  ArtSvpWriter *swr;
-  int i;
-
-  svp2_mod = (ArtSVP *) svp2; /* get rid of the const for a while */
-
-  /* First invert svp2 to "turn it inside out" */
-  for (i = 0; i < svp2_mod->n_segs; i++)
-    svp2_mod->segs[i].dir = !svp2_mod->segs[i].dir;
-
-  svp3 = art_svp_merge (svp1, svp2_mod);
-  swr = art_svp_writer_rewind_new (ART_WIND_RULE_POSITIVE);
-  art_svp_intersector (svp3, swr);
-  svp_new = art_svp_writer_rewind_reap (swr);
-  art_free (svp3); /* shallow free because svp3 contains shared segments */
-
-  /* Flip svp2 back to its original state */
-  for (i = 0; i < svp2_mod->n_segs; i++)
-    svp2_mod->segs[i].dir = !svp2_mod->segs[i].dir;
-
-  return svp_new;
-}
-#endif /* ART_USE_NEW_INTERSECTOR */
diff --git a/libart_lgpl/art_svp_ops.h b/libart_lgpl/art_svp_ops.h
index 1e511f5..8f150c2 100644
--- a/libart_lgpl/art_svp_ops.h
+++ b/libart_lgpl/art_svp_ops.h
@@ -28,10 +28,7 @@ extern "C" {
 
 /* Vector path set operations, over sorted vpaths. */
 
-ArtSVP *art_svp_union (const ArtSVP *svp1, const ArtSVP *svp2);
 ArtSVP *art_svp_intersect (const ArtSVP *svp1, const ArtSVP *svp2);
-ArtSVP *art_svp_diff (const ArtSVP *svp1, const ArtSVP *svp2);
-ArtSVP *art_svp_minus (const ArtSVP *svp1, const ArtSVP *svp2);
 
 #ifdef __cplusplus
 }
diff --git a/libart_lgpl/art_svp_wind.h b/libart_lgpl/art_svp_wind.h
index 0e9d5e7..fd999b4 100644
--- a/libart_lgpl/art_svp_wind.h
+++ b/libart_lgpl/art_svp_wind.h
@@ -39,13 +39,6 @@ typedef enum {
 } ArtWindRule;
 #endif
 
-ArtSVP *
-art_svp_uncross (ArtSVP *vp);
-
-ArtSVP *
-art_svp_rewind_uncrossed (ArtSVP *vp, ArtWindRule rule);
-
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/libart_lgpl/art_vpath.c b/libart_lgpl/art_vpath.c
index fa7b903..5152188 100644
--- a/libart_lgpl/art_vpath.c
+++ b/libart_lgpl/art_vpath.c
@@ -63,77 +63,6 @@ art_vpath_add_point (ArtVpath **p_vpath, int *pn_points, int *pn_points_max,
 #define CIRCLE_STEPS 128
 
 /**
- * art_vpath_new_circle: Create a new circle.
- * @x: X coordinate of center.
- * @y: Y coordinate of center.
- * @r: radius.
- *
- * Creates a new polygon closely approximating a circle with center
- * (@x, @y) and radius @r. Currently, the number of points used in the
- * approximation is fixed, but that will probably change.
- *
- * Return value: The newly created #ArtVpath.
- **/
-ArtVpath *
-art_vpath_new_circle (double x, double y, double r)
-{
-  int i;
-  ArtVpath *vec;
-  double theta;
-
-  vec = art_new (ArtVpath, CIRCLE_STEPS + 2);
-
-  for (i = 0; i < CIRCLE_STEPS + 1; i++)
-    {
-      vec[i].code = i ? ART_LINETO : ART_MOVETO;
-      theta = (i & (CIRCLE_STEPS - 1)) * (M_PI * 2.0 / CIRCLE_STEPS);
-      vec[i].x = x + r * cos (theta);
-      vec[i].y = y - r * sin (theta);
-    }
-  vec[i].code = ART_END;
-
-  return vec;
-}
-
-/**
- * art_vpath_affine_transform: Affine transform a vpath.
- * @src: Source vpath to transform.
- * @matrix: Affine transform.
- *
- * Computes the affine transform of the vpath, using @matrix as the
- * transform. @matrix is stored in the same format as PostScript, ie.
- * x' = @matrix[0] * x + @matrix[2] * y + @matrix[4]
- * y' = @matrix[1] * x + @matrix[3] * y + @matrix[5]
- *
- * Return value: the newly allocated vpath resulting from the transform.
-**/
-ArtVpath *
-art_vpath_affine_transform (const ArtVpath *src, const double matrix[6])
-{
-  int i;
-  int size;
-  ArtVpath *new;
-  double x, y;
-
-  for (i = 0; src[i].code != ART_END; i++);
-  size = i;
-
-  new = art_new (ArtVpath, size + 1);
-
-  for (i = 0; i < size; i++)
-    {
-      new[i].code = src[i].code;
-      x = src[i].x;
-      y = src[i].y;
-      new[i].x = matrix[0] * x + matrix[2] * y + matrix[4];
-      new[i].y = matrix[1] * x + matrix[3] * y + matrix[5];
-    }
-  new[i].code = ART_END;
-
-  return new;
-}
-
-/**
  * art_vpath_bbox_drect: Determine bounding box of vpath.
  * @vec: Source vpath.
  * @drect: Where to store bounding box.
@@ -184,58 +113,3 @@ art_vpath_bbox_irect (const ArtVpath *vec, ArtIRect *irect)
   art_drect_to_irect (irect, &drect);
 }
 
-#define PERTURBATION 2e-3
-
-/**
- * art_vpath_perturb: Perturb each point in vpath by small random amount.
- * @src: Source vpath.
- *
- * Perturbs each of the points by a small random amount. This is
- * helpful for cheating in cases when algorithms haven't attained
- * numerical stability yet.
- *
- * Return value: Newly allocated vpath containing perturbed @src.
- **/ 
-ArtVpath *
-art_vpath_perturb (ArtVpath *src)
-{
-  int i;
-  int size;
-  ArtVpath *new;
-  double x, y;
-  double x_start, y_start;
-  int open;
-
-  for (i = 0; src[i].code != ART_END; i++);
-  size = i;
-
-  new = art_new (ArtVpath, size + 1);
-
-  x_start = 0;
-  y_start = 0;
-  open = 0;
-  for (i = 0; i < size; i++)
-    {
-      new[i].code = src[i].code;
-      x = src[i].x + (PERTURBATION * rand ()) / RAND_MAX - PERTURBATION * 0.5;
-      y = src[i].y + (PERTURBATION * rand ()) / RAND_MAX - PERTURBATION * 0.5;
-      if (src[i].code == ART_MOVETO)
-	{
-	  x_start = x;
-	  y_start = y;
-	  open = 0;
-	}
-      else if (src[i].code == ART_MOVETO_OPEN)
-	open = 1;
-      if (!open && (i + 1 == size || src[i + 1].code != ART_LINETO))
-	{
-	  x = x_start;
-	  y = y_start;
-	}
-      new[i].x = x;
-      new[i].y = y;
-    }
-  new[i].code = ART_END;
-
-  return new;
-}
diff --git a/libart_lgpl/art_vpath.h b/libart_lgpl/art_vpath.h
index 4102d28..f5557f6 100644
--- a/libart_lgpl/art_vpath.h
+++ b/libart_lgpl/art_vpath.h
@@ -44,21 +44,12 @@ void
 art_vpath_add_point (ArtVpath **p_vpath, int *pn_points, int *pn_points_max,
 		     ArtPathcode code, double x, double y);
 
-ArtVpath *
-art_vpath_new_circle (double x, double y, double r);
-
-ArtVpath *
-art_vpath_affine_transform (const ArtVpath *src, const double matrix[6]);
-
 void
 art_vpath_bbox_drect (const ArtVpath *vec, ArtDRect *drect);
 
 void
 art_vpath_bbox_irect (const ArtVpath *vec, ArtIRect *irect);
 
-ArtVpath *
-art_vpath_perturb (ArtVpath *src);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/libart_lgpl/libart.h b/libart_lgpl/libart.h
index 4a9eeea..6d93588 100644
--- a/libart_lgpl/libart.h
+++ b/libart_lgpl/libart.h
@@ -27,7 +27,6 @@
 #include <libart_lgpl/art_svp_vpath_stroke.h>
 #include <libart_lgpl/art_svp_wind.h>
 #include <libart_lgpl/art_uta.h>
-#include <libart_lgpl/art_uta_ops.h>
 #include <libart_lgpl/art_uta_rect.h>
 #include <libart_lgpl/art_uta_svp.h>
 #include <libart_lgpl/art_uta_vpath.h>
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index c7e58ae..93a7aad 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -42,9 +42,7 @@
 #include <pango/pangoft2.h>
 
 #include <libart_lgpl/art_affine.h>
-#include <libart_lgpl/art_rgb_a_affine.h>
 #include <libart_lgpl/art_rgb.h>
-#include <libart_lgpl/art_rgb_bitmap_affine.h>
 #include "gnome-canvas-util.h"
 #include "gnome-canvas-i18n.h"
 
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 3241283..d89eb19 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -86,7 +86,6 @@
 #include <libart_lgpl/art_rect.h>
 #include <libart_lgpl/art_rect_uta.h>
 #include <libart_lgpl/art_uta_rect.h>
-#include <libart_lgpl/art_uta_ops.h>
 
 #include "gnome-canvas-marshal.h"
 #include "gnome-canvas-marshal.c"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]