Add unaligned boxes to "operator-source" test
These ref images might be wrong. Since the test failed here already before this change, I took the old ref images and copied the new part from the test output underneath it. For the backends that I don't have, I deleted the images (sorry). After this, the "operator-source" test still fails for me on all backends, but much more prominently so for the image backend. xcb-render-0.0/argb32 gets compared against a rgb24 ref image, but apparently this was already the case before(?). The rest are minor differences. This reveals a bug in the image backend. This was originally reported here: http://lists.cairographics.org/archives/cairo/2011-March/021827.html Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
@ -22,6 +22,7 @@
|
|||
*
|
||||
* Authors: Kristian Høgsberg <krh@redhat.com>
|
||||
* Owen Taylor <otaylor@redhat.com>
|
||||
* Uli Schlachter <psychon@znc.in>
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
|
@ -145,12 +146,15 @@ draw_polygon (cairo_t *cr, int x, int y)
|
|||
}
|
||||
|
||||
static void
|
||||
draw_rects (cairo_t *cr, int x, int y)
|
||||
draw_rects (cairo_t *cr, int x, int y, double offset)
|
||||
{
|
||||
double block_width = (int)(0.33 * WIDTH + 0.5);
|
||||
double block_height = (int)(0.33 * HEIGHT + 0.5);
|
||||
double block_width = (int)(0.33 * WIDTH + 0.5) - offset/3;
|
||||
double block_height = (int)(0.33 * HEIGHT + 0.5) - offset/3;
|
||||
int i, j;
|
||||
|
||||
x += offset/2;
|
||||
y += offset/2;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (j = 0; j < 3; j++)
|
||||
if ((i + j) % 2 == 0)
|
||||
|
|
@ -161,6 +165,18 @@ draw_rects (cairo_t *cr, int x, int y)
|
|||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_aligned_rects (cairo_t *cr, int x, int y)
|
||||
{
|
||||
draw_rects (cr, x, y, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_unaligned_rects (cairo_t *cr, int x, int y)
|
||||
{
|
||||
draw_rects (cr, x, y, 2.1);
|
||||
}
|
||||
|
||||
static void (* const pattern_funcs[])(cairo_t *cr, int x, int y) = {
|
||||
set_solid_pattern,
|
||||
set_translucent_pattern,
|
||||
|
|
@ -172,7 +188,8 @@ static void (* const draw_funcs[])(cairo_t *cr, int x, int y) = {
|
|||
draw_mask,
|
||||
draw_glyphs,
|
||||
draw_polygon,
|
||||
draw_rects
|
||||
draw_aligned_rects,
|
||||
draw_unaligned_rects
|
||||
};
|
||||
|
||||
#define IMAGE_WIDTH (ARRAY_LENGTH (pattern_funcs) * (WIDTH + PAD) + PAD)
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 4.3 KiB |