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);
9 $surface = new CairoImageSurface(FORMAT_RGB24
,
10 $surface_size, $surface_size);
11 $con2 = new CairoContext($surface);
12 $con2->setSourceRgb ( 1, 1, 1);
15 $surface_size / 2, $surface_size / 2);
17 $con2->setSourceRgb ( 1, 0, 0);
20 $surface_size / 2, $surface_size / 2);
22 $con2->setSourceRgb ( 0, 1, 0);
25 $surface_size / 2, $surface_size / 2);
27 $con2->setSourceRgb ( 0, 0, 1);
29 $surface_size / 2, $surface_size / 2,
30 $surface_size / 2, $surface_size / 2);
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);
41 $con->setSource($pattern);
43 $sur->writeToPng("extend-pad-php.png");