xref: /PHP-7.3/ext/gd/tests/imagepolygon_aa.phpt (revision 45f7b2bc)
1--TEST--
2antialiased imagepolygon()
3--SKIPIF--
4<?php
5if (!extension_loaded('gd')) die('skip gd extension not available');
6?>
7--FILE--
8<?php
9require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
10
11$im = imagecreatetruecolor(100, 100);
12$white = imagecolorallocate($im, 255, 255, 255);
13$black = imagecolorallocate($im, 0, 0, 0);
14imagefilledrectangle($im, 0,0, 99,99, $white);
15imageantialias($im, true);
16
17imagepolygon($im, [10,10, 49,89, 89,49], 3, $black);
18
19test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'imagepolygon_aa.png', $im);
20?>
21===DONE===
22--EXPECT--
23The images are equal.
24===DONE===
25