5 #include "pixman-inlines.h"
7 /* A trivial reference implementation for
8 * 'bilinear_pad_repeat_get_scanline_bounds'
11 bilinear_pad_repeat_get_scanline_bounds_ref (int32_t source_image_width,
13 pixman_fixed_t unit_x,
31 if (vx + pixman_fixed_1 < 0)
36 else if (vx + pixman_fixed_1 >= pixman_int_to_fixed (source_image_width))
38 if (vx >= pixman_int_to_fixed (source_image_width))
56 for (i = 0; i < 10000; i++)
58 int32_t left_pad1, left_tz1, width1, right_tz1, right_pad1;
59 int32_t left_pad2, left_tz2, width2, right_tz2, right_pad2;
60 pixman_fixed_t vx = prng_rand_n(10000 << 16) - (3000 << 16);
61 int32_t width = prng_rand_n(10000);
62 int32_t source_image_width = prng_rand_n(10000) + 1;
63 pixman_fixed_t unit_x = prng_rand_n(10 << 16) + 1;
64 width1 = width2 = width;
66 bilinear_pad_repeat_get_scanline_bounds_ref (source_image_width,
75 bilinear_pad_repeat_get_scanline_bounds (source_image_width,
84 assert (left_pad1 == left_pad2);
85 assert (left_tz1 == left_tz2);
86 assert (width1 == width2);
87 assert (right_tz1 == right_tz2);
88 assert (right_pad1 == right_pad2);