Exemple #1
0
/**
 * cpml_segment_to_cairo:
 * @segment: a #CpmlSegment
 * @cr: the destination cairo context
 *
 * Appends the path of @segment to @cr. The segment is "flattened",
 * that is %CPML_ARC primitives are approximated by one or more
 * %CPML_CURVE using cpml_arc_to_cairo(). Check its documentation
 * for further details.
 *
 * Since: 1.0
 **/
void
cpml_segment_to_cairo(const CpmlSegment *segment, cairo_t *cr)
{
    CpmlPrimitive primitive;

    cpml_primitive_from_segment(&primitive, (CpmlSegment *) segment);

    do {
        cpml_primitive_to_cairo(&primitive, cr);
    } while (cpml_primitive_next(&primitive));
}
Exemple #2
0
static void
_cpml_sanity_to_cairo(gint i)
{
    CpmlSegment segment;
    CpmlPrimitive primitive;

    cpml_segment_from_cairo(&segment, (cairo_path_t *) adg_test_path());
    cpml_primitive_from_segment(&primitive, &segment);

    switch (i) {
    case 1:
        cpml_primitive_to_cairo(NULL, adg_test_cairo_context());
        break;
    case 2:
        cpml_primitive_to_cairo(&primitive, NULL);
        break;
    default:
        g_test_trap_assert_failed();
        break;
    }
}