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);
16 $c->setSourceRgb(0,0,1);
19 $c->setSourceRgb(1,1,1);
20 $c->rectangle($size/2 - $linewidth/2, $border, $linewidth, $size - 2*$border);
23 $c2 = new CairoContext($sur);
24 $c2->setSourceRgb(1,1,1);
25 $c2->rectangle($size - $border - $linewidth, $border, $linewidth, $size - 2 * $border);
28 $con->setSourceRgb(1,1,1);
29 $con->rectangle($border, $border, $linewidth, $size - 2 * $border);
32 $sur->writeToPng("clip-nesting-php.png");