Updating checkpoint ...
[phpCairo.git] / testcases / phpCairo / clip-fill-rule.php
blobc55feee3343e21ade224b83ed4b6cbb3a86bed15
1 <?
2 $starsize = 20;
3 $sur = new CairoImageSurface(FORMAT_ARGB32, $starsize * 2 + 2, $starsize+2);
4 $con = new CairoContext($sur);
5 $con->setSourceRgb(1,0,0);
6 //$con->paint();
7 $con->translate(1,1);
8 $con->save();
10 $con->moveTo(10, 0);
11 $con->relLineTo ( 6, 20);
12 $con->relLineTo ( -16, -12);
13 $con->relLineTo ( 20, 0);
14 $con->relLineTo ( -16, 12);
16 $con->setFillRule (FILL_RULE_WINDING);
17 $con->clip ();
18 $con->paint ();
20 $con->restore ();
21 $con->translate ($starsize + 1, 0);
22 $con->save ();
24 $con->moveTo(10, 0);
25 $con->relLineTo ( 6, 20);
26 $con->relLineTo ( -16, -12);
27 $con->relLineTo ( 20, 0);
28 $con->relLineTo ( -16, 12);
30 $con->setFillRule (FILL_RULE_EVEN_ODD);
31 $con->clip ();
32 $con->paint ();
34 $con->restore();
35 $sur->writeToPng("clip-fill-rule-php.png");