Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / extend-pad.php
blob6f9edc56fe2a64bcbfd7af9d411e01f47f94f73d
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32,90, 90);
3 $con = new CairoContext($sur);
5 $surface_size = (90 - 30) / 10;
6 $con->setSourceRgba ( 0, 0, 0, 1);
7 $con->rectangle ( 0, 0, 90, 90);
8 $con->fill ();
9 $surface = new CairoImageSurface(FORMAT_RGB24,
10 $surface_size, $surface_size);
11 $con2 = new CairoContext($surface);
12 $con2->setSourceRgb ( 1, 1, 1);
13 $con2->rectangle (
14 0, 0,
15 $surface_size / 2, $surface_size / 2);
16 $con2->fill ();
17 $con2->setSourceRgb ( 1, 0, 0);
18 $con2->rectangle (
19 $surface_size / 2, 0,
20 $surface_size / 2, $surface_size / 2);
21 $con2->fill ();
22 $con2->setSourceRgb ( 0, 1, 0);
23 $con2->rectangle (
24 0, $surface_size / 2,
25 $surface_size / 2, $surface_size / 2);
26 $con2->fill ();
27 $con2->setSourceRgb ( 0, 0, 1);
28 $con2->rectangle (
29 $surface_size / 2, $surface_size / 2,
30 $surface_size / 2, $surface_size / 2);
31 $con2->fill ();
33 $con->scale ( 10, 10);
34 $con->setSourceSurface ( $surface, 1.5, 1.5);
36 /* Using EXTEND_REFLECT makes this test pass for image and xlib backends */
37 $pattern = $con->getSource();
38 $pattern->setExtend(EXTEND_PAD);
39 $con->rectangle ( 1.5, 1.5, 6, 6);
40 $con->clip ();
41 $con->setSource($pattern);
42 $con->paint ();
43 $sur->writeToPng("extend-pad-php.png");