mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-22 20:50:11 +01:00
Add cairo_stroke_preserve, cairo_fill_preserve, and cairo_clip_preserve. Rip the path out of cairo_gstate_t. Add path to cairo_t. Bring in most of the path code that used to live in cairo-gstate.c Move arc generation code into its own file. Accept path+ctm_inverse+tolerance instead of gstate. Absorb flattening and device space->user space conversion that used to be in _cairo_gstate_intepret_path. Prefer cairo_fixed_t parameters over ciaro_point_t for cross-file interfaces. Track changes in _cairo_path_fixed interfaces. Port to use cairo_fill_preserve rather than cairo_save/cairo_restore which no longer work for saving the path. Remove get and set of current point since it is no longer affected by cairo_save and cairo_restore. Add get and set testing for cairo_matrix_t.
63 lines
1.9 KiB
C
63 lines
1.9 KiB
C
/*
|
|
* Copyright © 2005 Red Hat, Inc.
|
|
*
|
|
* Permission to use, copy, modify, distribute, and sell this software
|
|
* and its documentation for any purpose is hereby granted without
|
|
* fee, provided that the above copyright notice appear in all copies
|
|
* and that both that copyright notice and this permission notice
|
|
* appear in supporting documentation, and that the name of
|
|
* Red Hat, Inc. not be used in advertising or publicity pertaining to
|
|
* distribution of the software without specific, written prior
|
|
* permission. Red Hat, Inc. makes no representations about the
|
|
* suitability of this software for any purpose. It is provided "as
|
|
* is" without express or implied warranty.
|
|
*
|
|
* RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
* FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
|
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*
|
|
* Author: Carl D. Worth <cworth@cworth.org>
|
|
*/
|
|
|
|
#include "cairo-test.h"
|
|
|
|
#define PAD 2
|
|
#define SIZE 10
|
|
|
|
cairo_test_t test = {
|
|
"fill-and-stroke",
|
|
"Tests calls to various set_source functions",
|
|
2 * SIZE + 4 * PAD, SIZE + 2 * PAD
|
|
};
|
|
|
|
static cairo_test_status_t
|
|
draw (cairo_t *cr, int width, int height)
|
|
{
|
|
cairo_rectangle (cr, PAD, PAD, SIZE, SIZE);
|
|
cairo_set_source_rgb (cr, 0, 0, 1);
|
|
cairo_fill_preserve (cr);
|
|
cairo_set_source_rgb (cr, 1, 0, 0);
|
|
cairo_stroke (cr);
|
|
|
|
cairo_translate (cr, SIZE + 2 * PAD, 0);
|
|
|
|
cairo_arc (cr,
|
|
PAD + SIZE / 2, PAD + SIZE / 2,
|
|
SIZE / 2,
|
|
0, 2 * M_PI);
|
|
cairo_fill_preserve (cr);
|
|
cairo_set_source_rgb (cr, 0, 0, 1);
|
|
cairo_stroke (cr);
|
|
|
|
return CAIRO_TEST_SUCCESS;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
return cairo_test (&test, draw);
|
|
}
|