[spans] Round rasterization grid pixel areas instead of truncating.
When converting a grid pixel area into the range [0,255] the GRID_AREA_TO_ALPHA() macro would truncate extra bits off the result rather than rounding. This could cause seams between abutting collinear edges of separately rendered polygons even when the coordinates of the abutting edges were the same. Reported by Soeren Sandmann on the cairo mailing list: http://lists.cairographics.org/archives/cairo/2009-May/017043.html
|
|
@ -295,9 +295,9 @@ typedef int grid_area_t;
|
|||
#elif GRID_XY == 15
|
||||
# define GRID_AREA_TO_ALPHA(c) (((c) << 4) + (c))
|
||||
#elif GRID_XY == 2*256*15
|
||||
# define GRID_AREA_TO_ALPHA(c) (((c) + ((c)<<4)) >> 9)
|
||||
# define GRID_AREA_TO_ALPHA(c) (((c) + ((c)<<4) + 256) >> 9)
|
||||
#else
|
||||
# define GRID_AREA_TO_ALPHA(c) ((c)*255 / GRID_XY) /* tweak me for rounding */
|
||||
# define GRID_AREA_TO_ALPHA(c) (((c)*255 + GRID_XY/2) / GRID_XY)
|
||||
#endif
|
||||
|
||||
#define UNROLL3(x) x x x
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 632 B |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1 KiB |
BIN
test/operator-clear.test-fallback.ref.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
test/operator-clear.xlib.ref.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.8 KiB |