Huw Davies : gdi32: Add a helper to retrieve the octant bias.
Alexandre Julliard
julliard at winehq.org
Wed Nov 16 12:46:46 CST 2011
Module: wine
Branch: master
Commit: 666f83bc0f82c4d8bae2f30f7a6dee8f2d4cf584
URL: http://source.winehq.org/git/wine.git/?a=commit;h=666f83bc0f82c4d8bae2f30f7a6dee8f2d4cf584
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Nov 16 11:20:53 2011 +0000
gdi32: Add a helper to retrieve the octant bias.
---
dlls/gdi32/dibdrv/objects.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index 3de6cb9..c0dd7d2 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -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++)
{
More information about the wine-cvs
mailing list