Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / mask-surface-ctm.php
blob57a6609049dc32050bbce97ebb3d32adbb307940
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32, 10, 10);
3 $con = new CairoContext($sur);
5 $data="";
6 for($i = 0; $i<4; $i++) {
7 $data = $data . chr(0x80);
8 $data = $data . chr(0x00);
9 $data = $data . chr(0x00);
10 $data = $data . chr(0x00);
13 $s = new CairoImageSurface(FORMAT_ARGB32,1,1);
14 $s->createFromData(data,FORMAT_ARGB32, 2, 2, 8);
15 //$pat = new CairoSurfacePattern($s);
16 $con->setSourceRgb(1,0,0);
18 $con->save();
19 $con->translate(2,2);
20 $con->maskSurface($s,0,0);
21 $con->restore();
23 $con->maskSurface($s,4,4);
25 //$mat = new CairoMatrix();
26 $con->translate(2,2);
27 //$pat->setMatrix($mat);
29 $con->maskSurface($s,4,4);
32 $sur->writeToPng("mask-surface-ctm-php.png");