diff options
author | marha <marha@users.sourceforge.net> | 2014-05-23 19:36:09 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-05-23 19:38:24 +0200 |
commit | 63bfcd0be46413dda8c22b914d12f66ea5d5c66d (patch) | |
tree | 252bfea78ff3ccfabedc3b84c8a7331c74e902cd /pixman/test | |
parent | 55cf29d7f748b814a2b8eb016fbf15635d56aa53 (diff) | |
download | vcxsrv-63bfcd0be46413dda8c22b914d12f66ea5d5c66d.tar.gz vcxsrv-63bfcd0be46413dda8c22b914d12f66ea5d5c66d.tar.bz2 vcxsrv-63bfcd0be46413dda8c22b914d12f66ea5d5c66d.zip |
libX11 mesa xserver pixman git update 23 May 2014
xserver commit db2e708f31a162c6c66643d3559dd5f3e21ee06b
libX11 commit e3dc0d17339e61eaf0b51b8907510984e3bf23cb
pixman commit 9cd283b2eb8279824406bfd47b020d21fc00cf82
mesa commit 404387ecd72a4a9ace8c1fa6895823aabfd759ad
Diffstat (limited to 'pixman/test')
-rw-r--r-- | pixman/test/Makefile.sources | 1 | ||||
-rw-r--r-- | pixman/test/radial-invalid.c | 54 | ||||
-rw-r--r-- | pixman/test/utils.c | 10 | ||||
-rw-r--r-- | pixman/test/utils.h | 1 |
4 files changed, 66 insertions, 0 deletions
diff --git a/pixman/test/Makefile.sources b/pixman/test/Makefile.sources index 9b520ec42..c7f165730 100644 --- a/pixman/test/Makefile.sources +++ b/pixman/test/Makefile.sources @@ -2,6 +2,7 @@ TESTPROGRAMS = \ prng-test \ a1-trap-test \ + radial-invalid \ pdf-op-test \ region-test \ region-translate-test \ diff --git a/pixman/test/radial-invalid.c b/pixman/test/radial-invalid.c new file mode 100644 index 000000000..ec85fe320 --- /dev/null +++ b/pixman/test/radial-invalid.c @@ -0,0 +1,54 @@ +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include "utils.h" + +#define WIDTH 100 +#define HEIGHT 100 + +int +main () +{ + pixman_image_t *radial; + pixman_image_t *dest = pixman_image_create_bits ( + PIXMAN_a8r8g8b8, WIDTH, HEIGHT, NULL, -1); + + static const pixman_transform_t xform = + { + { { 0x346f7, 0x0, 0x0 }, + { 0x0, 0x346f7, 0x0 }, + { 0x0, 0x0, 0x10000 } + }, + }; + + static const pixman_gradient_stop_t stops[] = + { + { 0xde61, { 0x4481, 0x96e8, 0x1e6a, 0x29e1 } }, + { 0xfdd5, { 0xfa10, 0xcc26, 0xbc43, 0x1eb7 } }, + { 0xfe1e, { 0xd257, 0x5bac, 0x6fc2, 0xa33b } }, + }; + + static const pixman_point_fixed_t inner = { 0x320000, 0x320000 }; + static const pixman_point_fixed_t outer = { 0x320000, 0x3cb074 }; + + enable_divbyzero_exceptions (); + enable_invalid_exceptions (); + + radial = pixman_image_create_radial_gradient ( + &inner, + &outer, + 0xab074, /* inner radius */ + 0x0, /* outer radius */ + stops, sizeof (stops) / sizeof (stops[0])); + + pixman_image_set_repeat (radial, PIXMAN_REPEAT_REFLECT); + pixman_image_set_transform (radial, &xform); + + pixman_image_composite ( + PIXMAN_OP_OVER, + radial, NULL, dest, + 0, 0, 0, 0, + 0, 0, WIDTH, HEIGHT); + + return 0; +} diff --git a/pixman/test/utils.c b/pixman/test/utils.c index 188841783..ab3424f9e 100644 --- a/pixman/test/utils.c +++ b/pixman/test/utils.c @@ -849,6 +849,16 @@ enable_divbyzero_exceptions (void) #endif } +void +enable_invalid_exceptions (void) +{ +#ifdef HAVE_FENV_H +#ifdef HAVE_FEENABLEEXCEPT + feenableexcept (FE_INVALID); +#endif +#endif +} + void * aligned_malloc (size_t align, size_t size) { diff --git a/pixman/test/utils.h b/pixman/test/utils.h index ebb14d9e4..6804334bb 100644 --- a/pixman/test/utils.h +++ b/pixman/test/utils.h @@ -120,6 +120,7 @@ fail_after (int seconds, const char *msg); /* If possible, enable traps for floating point exceptions */ void enable_divbyzero_exceptions(void); +void enable_invalid_exceptions(void); /* Converts a8r8g8b8 pixels to pixels that * - are not premultiplied, |