2 * Permission is hereby granted, free of charge, to any person
3 * obtaining a copy of this software and associated documentation
4 * files (the "Software"), to deal in the Software without
5 * restriction, including without limitation the rights to use, copy,
6 * modify, merge, publish, distribute, sublicense, and/or sell copies
7 * of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be
11 * included in all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
17 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
18 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * Author: Krzysztof Kosi\u0144ski <tweenk.pl@gmail.com>
25 /* Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40918 */
27 #include "cairo-test.h"
29 static cairo_test_status_t
30 draw (cairo_t *cr, int width, int height)
32 cairo_pattern_t *radial;
36 cairo_set_source_rgb (cr, 0, 0, 1);
41 for (i = 0; i < 4; i++) {
42 for (j = 0; j < 4; j++) {
44 cairo_rectangle (cr, 100*i, 100*j, 100, 100);
47 radial = cairo_pattern_create_radial (cos (angle), sin (angle), 0,
49 cairo_pattern_add_color_stop_rgb (radial, 0.0, 1, 0, 0);
50 cairo_pattern_add_color_stop_rgb (radial, 1.0, 0, 1, 0);
52 cairo_translate (cr, 100*i+50, 100*j+50);
53 cairo_scale (cr, 50, -50);
54 cairo_set_source (cr, radial);
55 cairo_pattern_destroy (radial);
64 return CAIRO_TEST_SUCCESS;
67 CAIRO_TEST (radial_outer_focus,
68 "Exercises the condition of rendering a radial gradial on its outer focus",
69 "radial", /* keywords */
70 NULL, /* requirements */