xref: /php-src/ext/gd/tests/imagepolygon_aa.phpt (revision 0b8466f2)
1--TEST--
2antialiased imagepolygon()
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7if (!(imagetypes() & IMG_PNG)) {
8    die("skip No PNG support");
9}
10?>
11--FILE--
12<?php
13require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
14
15$im = imagecreatetruecolor(100, 100);
16$white = imagecolorallocate($im, 255, 255, 255);
17$black = imagecolorallocate($im, 0, 0, 0);
18imagefilledrectangle($im, 0,0, 99,99, $white);
19imageantialias($im, true);
20
21imagepolygon($im, [10,10, 49,89, 89,49], $black);
22
23test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'imagepolygon_aa.png', $im);
24?>
25--EXPECT--
26The images are equal.
27