gdi32: Add a helper to retrieve the octant bias.

This commit is contained in:
Huw Davies 2011-11-16 11:20:53 +00:00 committed by Alexandre Julliard
parent 48b1e66309
commit 666f83bc0f
1 changed files with 8 additions and 4 deletions

View File

@ -308,6 +308,12 @@ static inline DWORD get_octant_mask(int dx, int dy)
return 1 << (get_octant_number(dx, dy) - 1);
}
static inline int get_bias( DWORD mask )
{
/* Octants 3, 5, 6 and 8 take a bias */
return (mask & 0xb4) ? 1 : 0;
}
static void solid_pen_line_callback(dibdrv_physdev *pdev, INT x, INT y)
{
RECT rect;
@ -653,8 +659,7 @@ static BOOL solid_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end)
params.dx = abs(dx);
params.dy = abs(dy);
params.octant = get_octant_mask(dx, dy);
/* Octants 3, 5, 6 and 8 take a bias */
params.bias = (params.octant & 0xb4) ? 1 : 0;
params.bias = get_bias(params.octant);
for(i = 0; i < clip->numRects; i++)
{
@ -926,8 +931,7 @@ static BOOL dashed_pen_line(dibdrv_physdev *pdev, POINT *start, POINT *end)
params.dx = abs(dx);
params.dy = abs(dy);
params.octant = get_octant_mask(dx, dy);
/* Octants 3, 5, 6 and 8 take a bias */
params.bias = (params.octant & 0xb4) ? 1 : 0;
params.bias = get_bias(params.octant);
for(i = 0; i < clip->numRects; i++)
{