Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / clip-twice.php
blob8c8835e3580956096c831fc3667cae4d2ad6107c
1 <?
2 $width = 64;
3 $height = 64;
4 $sur = new CairoImageSurface(FORMAT_ARGB32, $width, $height);
5 $con = new CairoContext($sur);
6 $con->newPath();
7 $con->arc($width/2, $height/2, $width/3, 0, 2 * M_PI);
8 $con->clip();
9 $con->newPath();
10 $con->moveTo(0,0);
11 $con->lineTo($width/4, $height/2);
12 $con->lineTo(0, $height);
13 $con->lineTo($width, $height);
14 $con->lineTo(3*$width/4, $height/2);
15 $con->lineTo($width, 0);
16 $con->closePath();
17 $con->clip();
18 $con->setSourceRgb(0,0,0.6);
19 $con->newPath();
20 $con->moveTo(0,0);
21 $con->lineTo(0, $height);
22 $con->lineTo($width/2, 3*$height/4);
23 $con->lineTo($width, $height);
24 $con->lineTo($width, 0);
25 $con->lineTo($width/2, $height/4);
26 $con->closePath();
27 $con->fill();
28 $con->newPath();
29 $con->arc($width/2, $height/2, $width/5, 0, 2 * M_PI);
30 $con->clip();
31 $con->setSourceRgb(1,1,0);
32 $con->paint();
35 $sur->writeToPng("clip-twice-php.png");