5 $sur = new CairoImageSurface(FORMAT_ARGB32
, $size, $size);
6 $con = new CairoContext($sur);
7 $s = $con->get_group_target();
8 $c = new CairoContext($s);
10 $c->move_to($border, $border);
11 $c->line_to($border +
$linewidth, $border);
12 $c->line_to($size - $border, $size - $border);
13 $c->line_to($size - $border-$linewidth, $size - $border);
16 $c->set_source_rgb(0,0,1);
19 $c->set_source_rgb(1,1,1);
20 $c->rectangle($size/2 - $linewidth/2, $border, $linewidth, $size - 2*$border);
23 $c2 = new CairoContext($sur);
24 $c2->set_source_rgb(1,1,1);
25 $c2->rectangle($size - $border - $linewidth, $border, $linewidth, $size - 2 * $border);
28 $con->set_source_rgb(1,1,1);
29 $con->rectangle($border, $border, $linewidth, $size - 2 * $border);
32 $sur->write_to_png("clip-nesting-php.png");