Commit 40f30fb9 authored by Christian Persch's avatar Christian Persch

Use cairo_antialias_t directly

parent 42bc33e6
......@@ -44,32 +44,6 @@
static const cairo_user_data_key_t surface_pixel_data_key;
static void
_rsvg_cairo_set_shape_antialias (cairo_t * cr, ShapeRenderingProperty aa)
{
if (SHAPE_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (SHAPE_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_CRISP_EDGES == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (SHAPE_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
}
static void
_rsvg_cairo_set_text_antialias (cairo_t * cr, TextRenderingProperty aa)
{
if (TEXT_RENDERING_AUTO == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_OPTIMIZE_SPEED == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
else if (TEXT_RENDERING_OPTIMIZE_LEGIBILITY == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
else if (TEXT_RENDERING_GEOMETRIC_PRECISION == aa)
cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT);
}
static void
rsvg_pixmap_destroy (gchar * pixels, gpointer data)
{
......@@ -415,7 +389,7 @@ rsvg_cairo_render_pango_layout (RsvgDrawingCtx * ctx, PangoLayout * layout, doub
PangoRectangle ink;
RsvgBbox bbox;
_rsvg_cairo_set_text_antialias (render->cr, state->text_rendering_type);
cairo_set_antialias (render->cr, state->text_rendering_type);
_set_rsvg_affine (render, state->affine);
......@@ -485,7 +459,7 @@ rsvg_cairo_render_path (RsvgDrawingCtx * ctx, const RsvgBpathDef * bpath_def)
cr = render->cr;
_rsvg_cairo_set_shape_antialias (cr, state->shape_rendering_type);
cairo_set_antialias (cr, state->shape_rendering_type);
_set_rsvg_affine (render, state->affine);
......
......@@ -37,6 +37,20 @@
#define RSVG_DEFAULT_FONT "Times New Roman"
enum {
SHAPE_RENDERING_AUTO = CAIRO_ANTIALIAS_DEFAULT,
SHAPE_RENDERING_OPTIMIZE_SPEED = CAIRO_ANTIALIAS_NONE,
SHAPE_RENDERING_CRISP_EDGES = CAIRO_ANTIALIAS_NONE,
SHAPE_RENDERING_GEOMETRIC_PRECISION = CAIRO_ANTIALIAS_DEFAULT
};
enum {
TEXT_RENDERING_AUTO = CAIRO_ANTIALIAS_DEFAULT,
TEXT_RENDERING_OPTIMIZE_SPEED = CAIRO_ANTIALIAS_NONE,
TEXT_RENDERING_OPTIMIZE_LEGIBILITY = CAIRO_ANTIALIAS_DEFAULT,
TEXT_RENDERING_GEOMETRIC_PRECISION = CAIRO_ANTIALIAS_DEFAULT
};
typedef struct _StyleValueData {
gchar *value;
gboolean important;
......
......@@ -57,20 +57,6 @@ typedef enum {
UNICODE_BIDI_OVERRIDE = 2
} UnicodeBidi;
typedef enum {
SHAPE_RENDERING_AUTO = 0,
SHAPE_RENDERING_OPTIMIZE_SPEED,
SHAPE_RENDERING_CRISP_EDGES,
SHAPE_RENDERING_GEOMETRIC_PRECISION
} ShapeRenderingProperty;
typedef enum {
TEXT_RENDERING_AUTO = 0,
TEXT_RENDERING_OPTIMIZE_SPEED,
TEXT_RENDERING_OPTIMIZE_LEGIBILITY,
TEXT_RENDERING_GEOMETRIC_PRECISION
} TextRenderingProperty;
typedef enum {
RSVG_ENABLE_BACKGROUND_ACCUMULATE,
RSVG_ENABLE_BACKGROUND_NEW
......@@ -201,10 +187,10 @@ struct _RsvgState {
cairo_operator_t comp_op;
RsvgEnableBackgroundType enable_background;
ShapeRenderingProperty shape_rendering_type;
cairo_antialias_t shape_rendering_type;
gboolean has_shape_rendering_type;
TextRenderingProperty text_rendering_type;
cairo_antialias_t text_rendering_type;
gboolean has_text_rendering_type;
GHashTable *styles;
......
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