Commit 4dc53ecc authored by Dom Lachowicz's avatar Dom Lachowicz

steal libart's affine code. more work toward deprecating/purging libart

parent 459c450e
......@@ -5,6 +5,8 @@
gnome-vfs can see.
* *: Deprecate rsvg-gz. Move its functionality directly into RsvgHandle instead.
Greatly simplifies much code.
* rsvg-affine.c: Steal libart's matrix affine code
* *: Use above instead of libart's matrix affine functions
2005-02-23 Caleb Moore <c.moore@student.unsw.edu.au>
......
......@@ -29,6 +29,7 @@ lib_LTLIBRARIES = librsvg-2.la
librsvg_2_la_SOURCES = \
rsvg-gz.c \
rsvg-affine.c \
librsvg-features.c \
rsvg-bpath-util.c \
rsvg-bpath-util.h \
......
/* Libart_LGPL - library of basic graphic primitives
* Copyright (C) 1998 Raph Levien
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* Simple manipulations with affine transformations */
#include "config.h"
#include "rsvg-private.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
/**
* _rsvg_affine_invert: Find the inverse of an affine transformation.
* @dst: Where the resulting affine is stored.
* @src: The original affine transformation.
*
* All non-degenerate affine transforms are invertible. If the original
* affine is degenerate or nearly so, expect numerical instability and
* very likely core dumps on Alpha and other fp-picky architectures.
* Otherwise, @dst multiplied with @src, or @src multiplied with @dst
* will be (to within roundoff error) the identity affine.
**/
void
_rsvg_affine_invert (double dst[6], const double src[6])
{
double r_det;
r_det = 1.0 / (src[0] * src[3] - src[1] * src[2]);
dst[0] = src[3] * r_det;
dst[1] = -src[1] * r_det;
dst[2] = -src[2] * r_det;
dst[3] = src[0] * r_det;
dst[4] = -src[4] * dst[0] - src[5] * dst[2];
dst[5] = -src[4] * dst[1] - src[5] * dst[3];
}
/**
* _rsvg_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
_rsvg_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
/**
* _rsvg_affine_multiply: Multiply two affine transformation matrices.
* @dst: Where to store the result.
* @src1: The first affine transform to multiply.
* @src2: The second affine transform to multiply.
*
* Multiplies two affine transforms together, i.e. the resulting @dst
* is equivalent to doing first @src1 then @src2. Note that the
* PostScript concat operator multiplies on the left, i.e. "M concat"
* is equivalent to "CTM = multiply (M, CTM)";
*
* It is safe to call this function with @dst equal to @src1 or @src2.
**/
void
_rsvg_affine_multiply (double dst[6], const double src1[6], const double src2[6])
{
double d0, d1, d2, d3, d4, d5;
d0 = src1[0] * src2[0] + src1[1] * src2[2];
d1 = src1[0] * src2[1] + src1[1] * src2[3];
d2 = src1[2] * src2[0] + src1[3] * src2[2];
d3 = src1[2] * src2[1] + src1[3] * src2[3];
d4 = src1[4] * src2[0] + src1[5] * src2[2] + src2[4];
d5 = src1[4] * src2[1] + src1[5] * src2[3] + src2[5];
dst[0] = d0;
dst[1] = d1;
dst[2] = d2;
dst[3] = d3;
dst[4] = d4;
dst[5] = d5;
}
/**
* _rsvg_affine_identity: Set up the identity matrix.
* @dst: Where to store the resulting affine transform.
*
* Sets up an identity matrix.
**/
void
_rsvg_affine_identity (double dst[6])
{
dst[0] = 1;
dst[1] = 0;
dst[2] = 0;
dst[3] = 1;
dst[4] = 0;
dst[5] = 0;
}
/**
* _rsvg_affine_scale: Set up a scaling matrix.
* @dst: Where to store the resulting affine transform.
* @sx: X scale factor.
* @sy: Y scale factor.
*
* Sets up a scaling matrix.
**/
void
_rsvg_affine_scale (double dst[6], double sx, double sy)
{
dst[0] = sx;
dst[1] = 0;
dst[2] = 0;
dst[3] = sy;
dst[4] = 0;
dst[5] = 0;
}
/**
* _rsvg_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
_rsvg_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;
}
/**
* _rsvg_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
_rsvg_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;
}
/**
* _rsvg_affine_translate: Set up a translation matrix.
* @dst: Where to store the resulting affine transform.
* @tx: X translation amount.
* @tx: Y translation amount.
*
* Sets up a translation matrix.
**/
void
_rsvg_affine_translate (double dst[6], double tx, double ty)
{
dst[0] = 1;
dst[1] = 0;
dst[2] = 0;
dst[3] = 1;
dst[4] = tx;
dst[5] = ty;
}
/**
* _rsvg_affine_expansion: Find the affine's expansion factor.
* @src: The affine transformation.
*
* Finds the expansion factor, i.e. the square root of the factor
* by which the affine transform affects area. In an affine transform
* composed of scaling, rotation, shearing, and translation, returns
* the amount of scaling.
*
* Return value: the expansion factor.
**/
double
_rsvg_affine_expansion (const double src[6])
{
return sqrt (fabs (src[0] * src[3] - src[1] * src[2]));
}
/**
* _rsvg_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
_rsvg_affine_rectilinear (const double src[6])
{
return ((fabs (src[1]) < EPSILON && fabs (src[2]) < EPSILON) ||
(fabs (src[0]) < EPSILON && fabs (src[3]) < EPSILON));
}
/**
* _rsvg_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
_rsvg_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);
}
......@@ -37,7 +37,6 @@
#include "rsvg-art-mask.h"
#include <libart_lgpl/art_rgba.h>
#include <libart_lgpl/art_affine.h>
#include <libart_lgpl/art_rgb_svp.h>
static void
......@@ -513,15 +512,15 @@ rsvg_art_affine_image(GdkPixbuf *img, GdkPixbuf *intermediate,
intpix = gdk_pixbuf_get_pixels (intermediate);
basebpp = has_alpha ? 4 : 3;
art_affine_invert(raw_inv_affine, affine);
_rsvg_affine_invert(raw_inv_affine, affine);
/*scale to w and h*/
tmp_affine[0] = (double)w;
tmp_affine[3] = (double)h;
tmp_affine[1] = tmp_affine[2] = tmp_affine[4] = tmp_affine[5] = 0;
art_affine_multiply(tmp_affine, tmp_affine, affine);
_rsvg_affine_multiply(tmp_affine, tmp_affine, affine);
art_affine_invert(inv_affine, tmp_affine);
_rsvg_affine_invert(inv_affine, tmp_affine);
/*apply the transformation*/
......
......@@ -31,7 +31,6 @@
#include <libart_lgpl/art_rgb_affine.h>
#include <libart_lgpl/art_rgb_rgba_affine.h>
#include <libart_lgpl/art_rgb_svp.h>
#include <libart_lgpl/art_affine.h>
#include <libart_lgpl/art_svp_intersect.h>
#include <libart_lgpl/art_svp_ops.h>
......@@ -127,7 +126,7 @@ rsvg_calculate_svp_bounds (const ArtSVP *svp, double * useraffine)
float bigx, littlex, bigy, littley, assignedonce;
RsvgFRect output;
art_affine_invert(affine, useraffine);
_rsvg_affine_invert(affine, useraffine);
bigx = littlex = bigy = littley = assignedonce = 0;
for (i = 0; i < svp->n_segs; i++)
......@@ -302,7 +301,7 @@ rsvg_render_outline (RsvgState *state, ArtVpath *vpath)
/* todo: libart doesn't yet implement anamorphic scaling of strokes */
double stroke_width = state->stroke_width *
art_affine_expansion (state->affine);
_rsvg_affine_expansion (state->affine);
if (stroke_width < 0.25)
stroke_width = 0.25;
......@@ -560,7 +559,7 @@ void rsvg_art_render_image (RsvgDrawingCtx *ctx, GdkPixbuf * img,
tmp_tmp_affine[4] = x;
tmp_tmp_affine[5] = y;
art_affine_multiply(tmp_affine, tmp_tmp_affine, tmp_affine);
_rsvg_affine_multiply(tmp_affine, tmp_tmp_affine, tmp_affine);
intermediate = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 1, 8,
gdk_pixbuf_get_width (pixbuf),
......
......@@ -28,7 +28,6 @@
#include "rsvg-image.h"
#include "rsvg-css.h"
#include <libart_lgpl/art_rgba.h>
#include <libart_lgpl/art_affine.h>
#include <string.h>
#include <math.h>
......@@ -3778,7 +3777,7 @@ rsvg_filter_primitive_turbulence_render (RsvgFilterPrimitive * self,
output = _rsvg_pixbuf_new_cleared (GDK_COLORSPACE_RGB, 1, 8, width, height);
output_pixels = gdk_pixbuf_get_pixels (output);
art_affine_invert(affine, ctx->paffine);
_rsvg_affine_invert(affine, ctx->paffine);
for (y = 0; y < tileHeight; y++)
{
......@@ -4624,7 +4623,7 @@ rsvg_filter_primitive_diffuse_lighting_render (RsvgFilterPrimitive * self,
rawdy = oself->dy;
}
art_affine_invert(iaffine, ctx->paffine);
_rsvg_affine_invert(iaffine, ctx->paffine);
for (y = boundarys.y1; y < boundarys.y2; y++)
for (x = boundarys.x1; x < boundarys.x2; x++)
......@@ -4806,7 +4805,7 @@ rsvg_filter_primitive_specular_lighting_render (RsvgFilterPrimitive * self,
surfaceScale = oself->surfaceScale / 255.0;
art_affine_invert(iaffine, ctx->paffine);
_rsvg_affine_invert(iaffine, ctx->paffine);
for (y = boundarys.y1; y < boundarys.y2; y++)
for (x = boundarys.x1; x < boundarys.x2; x++)
......
......@@ -30,7 +30,6 @@
#include <string.h>
#include <math.h>
#include <errno.h>
#include <libart_lgpl/art_affine.h>
#include "rsvg-css.h"
static const char s_UTF8_B64Alphabet[64] = {
......
......@@ -32,7 +32,6 @@
#include "rsvg-mask.h"
#include "rsvg-image.h"
#include <libart_lgpl/art_affine.h>
#include <string.h>
#include <math.h>
#include <errno.h>
......@@ -189,7 +188,7 @@ rsvg_marker_render (RsvgMarker *self, gdouble x, gdouble y, gdouble orient, gdou
RsvgState * state = rsvg_state_current(ctx);
if (self->bbox) {
art_affine_scale(affine,linewidth * state->affine[0],
_rsvg_affine_scale(affine,linewidth * state->affine[0],
linewidth * state->affine[3]);
} else {
for (i = 0; i < 6; i++)
......@@ -217,25 +216,25 @@ rsvg_marker_render (RsvgMarker *self, gdouble x, gdouble y, gdouble orient, gdou
taffine[3] = h / self->vbh;
taffine[4] = x;
taffine[5] = y;
art_affine_multiply(affine, taffine, affine);
_rsvg_affine_multiply(affine, taffine, affine);
}
art_affine_translate(taffine, -self->refX, -self->refY);
_rsvg_affine_translate(taffine, -self->refX, -self->refY);
art_affine_multiply(affine, taffine, affine);
_rsvg_affine_multiply(affine, taffine, affine);
if (self->orientAuto)
rotation = orient * 180. / M_PI;
else
rotation = self->orient;
art_affine_rotate(taffine, rotation);
_rsvg_affine_rotate(taffine, rotation);
art_affine_multiply(affine, affine, taffine);
_rsvg_affine_multiply(affine, affine, taffine);
art_affine_translate(taffine, x, y);
_rsvg_affine_translate(taffine, x, y);
art_affine_multiply(affine, affine, taffine);
_rsvg_affine_multiply(affine, affine, taffine);
/*don't inherit anything from the current context*/
rsvg_state_finalize(state);
......
......@@ -33,7 +33,6 @@
#include <glib/gmem.h>
#include <glib/gmessages.h>
#include <glib/gstrfuncs.h>
#include <libart_lgpl/art_affine.h>
#include <libart_lgpl/art_render_mask.h>
#include <string.h>
#include <math.h>
......@@ -214,13 +213,13 @@ rsvg_paint_server_lin_grad_render (RsvgPaintServer *self, ArtRender *ar,
affine[3] = ctx->y1 - ctx->y0;
affine[4] = ctx->x0;
affine[5] = ctx->y0;
art_affine_multiply(affine, affine, ctx->affine);
_rsvg_affine_multiply(affine, affine, ctx->affine);
} else {
for (i = 0; i < 6; i++)
affine[i] = ctx->affine[i];
}
art_affine_multiply(affine, rlg->affine, affine);
_rsvg_affine_multiply(affine, rlg->affine, affine);
/*
in case I am hit by a bus, here is how the following code works:
......@@ -340,13 +339,13 @@ rsvg_paint_server_rad_grad_render (RsvgPaintServer *self, ArtRender *ar,
affine[3] = ctx->y1 - ctx->y0;
affine[4] = ctx->x0;
affine[5] = ctx->y0;
art_affine_multiply(affine, affine, ctx->affine);
_rsvg_affine_multiply(affine, affine, ctx->affine);
} else {
for (i = 0; i < 6; i++)
affine[i] = ctx->affine[i];
}
art_affine_multiply(affine, rrg->affine, affine);
_rsvg_affine_multiply(affine, rrg->affine, affine);
agr = z->agr;
if (agr == NULL)
......@@ -365,11 +364,11 @@ rsvg_paint_server_rad_grad_render (RsvgPaintServer *self, ArtRender *ar,
z->agr = agr;
}
art_affine_scale (aff1, rrg->r, rrg->r);
art_affine_translate (aff2, rrg->cx, rrg->cy);
art_affine_multiply (aff1, aff1, aff2);
art_affine_multiply (aff1, aff1, affine);
art_affine_invert (agr->affine, aff1);
_rsvg_affine_scale (aff1, rrg->r, rrg->r);
_rsvg_affine_translate (aff2, rrg->cx, rrg->cy);
_rsvg_affine_multiply (aff1, aff1, aff2);
_rsvg_affine_multiply (aff1, aff1, affine);
_rsvg_affine_invert (agr->affine, aff1);
/* todo: libart doesn't support spreads on radial gradients */
......@@ -504,7 +503,7 @@ render_image_pattern (ArtRender *render, guchar * pixels, gdouble x, gdouble y,
for (i = 0; i < 6; i++)
image_source->affine[i] = affine[i];
art_affine_invert(image_source->invaffine, affine);
_rsvg_affine_invert(image_source->invaffine, affine);
image_source->init = ART_FALSE;
......@@ -544,7 +543,7 @@ rsvg_paint_server_pattern_render (RsvgPaintServer *self, ArtRender *ar,
affine[3] = ctx->y1 - ctx->y0;
affine[4] = ctx->x0;
affine[5] = ctx->y0;
art_affine_multiply(affine, affine, ctx->affine);
_rsvg_affine_multiply(affine, affine, ctx->affine);
} else {
for (i = 0; i < 6; i++)
affine[i] = ctx->affine[i];
......@@ -570,7 +569,7 @@ rsvg_paint_server_pattern_render (RsvgPaintServer *self, ArtRender *ar,
caffine[3] = h / pattern->vbh;
caffine[4] = x;
caffine[5] = y;
art_affine_multiply(caffine, caffine, affine);
_rsvg_affine_multiply(caffine, caffine, affine);
}
else if (pattern->obj_cbbox) {
caffine[0] = ctx->x1 - ctx->x0;
......@@ -579,14 +578,14 @@ rsvg_paint_server_pattern_render (RsvgPaintServer *self, ArtRender *ar,
caffine[3] = ctx->y1 - ctx->y0;
caffine[4] = ctx->x0;
caffine[5] = ctx->y0;
art_affine_multiply(caffine, caffine, ctx->affine);
_rsvg_affine_multiply(caffine, caffine, ctx->affine);
} else {
for (i = 0; i < 6; i++)
caffine[i] = ctx->affine[i];
}
art_affine_multiply(affine, affine, pattern->affine);
art_affine_multiply(caffine, caffine, pattern->affine);
_rsvg_affine_multiply(affine, affine, pattern->affine);
_rsvg_affine_multiply(caffine, caffine, pattern->affine);
/*check if everything is going to be within the boundaries of the rendering surface*/
maxx = maxy = minx = miny = xoffset = yoffset = 0;
......
......@@ -229,6 +229,54 @@ void rsvg_add_clipping_rect (RsvgDrawingCtx *ctx, double x, double y,
double w, double h);
void
_rsvg_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
_rsvg_affine_flip (double dst_affine[6], const double src_affine[6],
int horz, int vert);
void
_rsvg_affine_multiply (double dst[6],
const double src1[6], const double src2[6]);
/* set up the identity matrix */
void
_rsvg_affine_identity (double dst[6]);
/* set up a scaling matrix */
void
_rsvg_affine_scale (double dst[6], double sx, double sy);
/* set up a rotation matrix; theta is given in degrees */
void
_rsvg_affine_rotate (double dst[6], double theta);
/* set up a shearing matrix; theta is given in degrees */
void
_rsvg_affine_shear (double dst[6], double theta);
/* set up a translation matrix */
void
_rsvg_affine_translate (double dst[6], double tx, double ty);
/* find the affine's "expansion factor", i.e. the scale amount */
double
_rsvg_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
_rsvg_affine_rectilinear (const double src[6]);
/* Determine whether two affine transformations are equal within grid allignment */
int
_rsvg_affine_equal (double matrix1[6], double matrix2[6]);
G_END_DECLS
#endif
......@@ -35,8 +35,6 @@
#include "rsvg-css.h"
#include "rsvg-defs.h"
#include <libart_lgpl/art_affine.h>
/* 4/3 * (1-cos 45ƒ)/sin 45ƒ = 4/3 * sqrt(2) - 1 */
#define RSVG_ARC_MAGIC ((double) 0.5522847498)
......
......@@ -30,8 +30,6 @@
#include "rsvg-image.h"
#include "rsvg-css.h"
#include <libart_lgpl/art_affine.h>
void
rsvg_defs_drawable_draw (RsvgDefsDrawable * self, RsvgDrawingCtx *ctx,
int dominate)
......@@ -178,8 +176,8 @@ rsvg_defs_drawable_use_resolve(RsvgDefsDrawableUse * self, RsvgDrawingCtx *ctx,
case RSVG_DEF_PATH:
{
art_affine_translate(affine, x, y);
art_affine_multiply(affine_out, affine, affine_out);
_rsvg_affine_translate(affine, x, y);
_rsvg_affine_multiply(affine_out, affine, affine_out);
return (RsvgDefsDrawable *)parent;
}
case RSVG_DEF_SYMBOL:
......@@ -194,19 +192,19 @@ rsvg_defs_drawable_use_resolve(RsvgDefsDrawableUse * self, RsvgDrawingCtx *ctx,
(symbol->preserve_aspect_ratio,
symbol->width, symbol->height,
&width, &height, &x, &y);
art_affine_translate(affine, x, y);
art_affine_multiply(affine_out, affine, affine_out);
_rsvg_affine_translate(affine, x, y);
_rsvg_affine_multiply(affine_out, affine, affine_out);
art_affine_scale(affine, width / symbol->width,
_rsvg_affine_scale(affine, width / symbol->width,
height / symbol->height);
art_affine_multiply(affine_out, affine, affine_out);
art_affine_translate(affine, -symbol->x,
_rsvg_affine_multiply(affine_out, affine, affine_out);
_rsvg_affine_translate(affine, -symbol->x,
-symbol->y);
art_affine_multiply(affine_out, affine, affine_out);
_rsvg_affine_multiply(affine_out, affine, affine_out);
}
else {
art_affine_translate(affine, x, y);
art_affine_multiply(affine_out, affine, affine_out);
_rsvg_affine_translate(affine, x, y);
_rsvg_affine_multiply(affine_out, affine, affine_out);
}
return drawable;
......@@ -338,7 +336,7 @@ rsvg_start_sub_svg (RsvgHandle *ctx, RsvgPropertyBag *atts)
affine[5] = y - vbox_y * height / vbox_h;
for (i = 0; i < 6; i++)
state.personal_affine[i] = affine[i];
art_affine_multiply(state.affine, affine,
_rsvg_affine_multiply(state.affine, affine,
state.affine);
ctx->width = vbox_w;
ctx->height = vbox_h;
......@@ -353,7 +351,7 @@ rsvg_start_sub_svg (RsvgHandle *ctx, RsvgPropertyBag *atts)
affine[5] = y;
for (i = 0; i < 6; i++)
state.personal_affine[i] = affine[i];
art_affine_multiply(state.affine, affine,
_rsvg_affine_multiply(state.affine, affine,
state.affine);
}
......
......@@ -34,27 +34,10 @@
#include "rsvg-mask.h"
#include "rsvg-marker.h"
#include <libart_lgpl/art_affine.h>
#include <libart_lgpl/art_svp_ops.h>
#define RSVG_DEFAULT_FONT "Times New Roman"
/*
static guint32
rsvg_state_current_color (RsvgState * cur_state, RsvgState * parent_state)
{
if (cur_state)
{
if (cur_state->has_current_color)
return cur_state->current_color;
else if (parent_state)
return parent_state->current_color;
}
return 0;
}
*/
gdouble
rsvg_viewport_percentage (gdouble width, gdouble height)
{
......@@ -72,8 +55,8 @@ rsvg_state_init (RsvgState *state)
{
memset (state, 0, sizeof (RsvgState));
art_affine_identity (state->affine);
art_affine_identity (state->personal_affine);
_rsvg_affine_identity (state->affine);
_rsvg_affine_identity (state->personal_affine);
state->mask = NULL;
state->opacity = 0xff;
state->adobe_blend = 0;
......@@ -1071,7 +1054,7 @@ rsvg_parse_transform (double dst[6], const char *src)
guint key_len;
double tmp_affine[6];
art_affine_identity (dst);
_rsvg_affine_identity (dst);
idx = 0;
while (src[idx])
......@@ -1141,7 +1124,7 @@ rsvg_parse_transform (double dst[6], const char *src)
{
if (n_args != 6)
return FALSE;
art_affine_multiply (dst, args, dst);
_rsvg_affine_multiply (dst, args, dst);
}
else if (!strcmp (keyword, "translate"))
{
......@@ -1149,8 +1132,8 @@ rsvg_parse_transform (double dst[6], const char *src)
args[1] = 0;
else if (n_args != 2)
return FALSE;
art_affine_translate (tmp_affine, args[0], args[1]);
art_affine_multiply (dst, tmp_affine, dst);
_rsvg_affine_translate (tmp_affine, args[0], args[1]);
_rsvg_affine_multiply (dst, tmp_affine, dst);
}
else if (!strcmp (keyword, "scale"))
{
......@@ -1158,23 +1141,23 @@ rsvg_parse_transform (double dst[6], const char *src)
args[1] = args[0];
else if (n_args != 2)
return FALSE;
art_affine_scale (tmp_affine, args[0], args[1]);