Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / clip-nesting.php
blobcefb34c2d8477f403a9ec7806a947eb95689a431
1 <?
2 $size = 100;
3 $border = 10;
4 $linewidth = 20;
5 $sur = new CairoImageSurface(FORMAT_ARGB32, $size, $size);
6 $con = new CairoContext($sur);
7 $s = $con->getGroupTarget();
8 $c = new CairoContext($s);
10 $c->moveTo($border, $border);
11 $c->lineTo($border + $linewidth, $border);
12 $c->lineTo($size - $border, $size - $border);
13 $c->lineTo($size - $border-$linewidth, $size - $border);
15 $c->clip();
16 $c->setSourceRgb(0,0,1);
17 $c->paint();
19 $c->setSourceRgb(1,1,1);
20 $c->rectangle($size/2 - $linewidth/2, $border, $linewidth, $size - 2*$border);
21 $c->fill();
23 $c2 = new CairoContext($sur);
24 $c2->setSourceRgb(1,1,1);
25 $c2->rectangle($size - $border - $linewidth, $border, $linewidth, $size - 2 * $border);
26 $c2->fill();
28 $con->setSourceRgb(1,1,1);
29 $con->rectangle($border, $border, $linewidth, $size - 2 * $border);
30 $con->fill();
32 $sur->writeToPng("clip-nesting-php.png");