gdi32: Pass the brush origin explicitly to the brush backend functions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-08-28 09:07:31 +02:00
parent b491635f0a
commit 97a9db43d2
4 changed files with 15 additions and 12 deletions

View File

@ -737,7 +737,8 @@ static DWORD create_tmp_dib( const dib_info *copy, int width, int height, dib_in
}
static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info *src,
const RECT *src_rect, const struct clipped_rects *clipped_rects, DWORD rop )
const RECT *src_rect, const struct clipped_rects *clipped_rects,
const POINT *brush_org, DWORD rop )
{
dib_info *dibs[3], *result = src, tmp;
RECT rects[3];
@ -784,10 +785,10 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info *
break;
case OP_ARGS(PAT,DST):
pdev->brush.rects( pdev, &pdev->brush, dibs[DST], clipped_rects->count, clipped_rects->rects,
OP_ROP(*opcode) );
brush_org, OP_ROP(*opcode) );
break;
case OP_ARGS(PAT,SRC):
pdev->brush.rects( pdev, &pdev->brush, dibs[SRC], 1, &rects[SRC], OP_ROP(*opcode) );
pdev->brush.rects( pdev, &pdev->brush, dibs[SRC], 1, &rects[SRC], brush_org, OP_ROP(*opcode) );
break;
}
}
@ -1026,7 +1027,8 @@ DWORD dibdrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
mask_rect( &pdev->dib, &dst->visrect, &src_dib, &src->visrect, &clipped_rects, rop2 );
}
else
ret = execute_rop( pdev, &dst->visrect, &src_dib, &src->visrect, &clipped_rects, rop );
ret = execute_rop( pdev, &dst->visrect, &src_dib, &src->visrect, &clipped_rects,
&dc->brush_org, rop );
free_clipped_rects( &clipped_rects );
}
if (tmp_rgn) DeleteObject( tmp_rgn );

View File

@ -75,7 +75,7 @@ typedef struct dib_brush
rop_mask_bits masks;
struct brush_pattern pattern;
BOOL (*rects)(struct dibdrv_physdev *pdev, struct dib_brush *brush, dib_info *dib,
int num, const RECT *rects, INT rop);
int num, const RECT *rects, const POINT *brush_org, INT rop);
} dib_brush;
struct intensity_range

View File

@ -74,7 +74,7 @@ static BOOL brush_rect( dibdrv_physdev *pdev, dib_brush *brush, const RECT *rect
if (!get_clipped_rects( &pdev->dib, rect, clip, &clipped_rects )) return TRUE;
ret = brush->rects( pdev, brush, &pdev->dib, clipped_rects.count, clipped_rects.rects,
dc->ROPmode );
&dc->brush_org, dc->ROPmode );
free_clipped_rects( &clipped_rects );
return ret;
}
@ -1174,6 +1174,7 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
{
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
dib_brush *brush = &pdev->brush;
DC *dc = get_physdev_dc( dev );
int rop2 = get_rop2_from_rop( rop );
struct clipped_rects clipped_rects;
DWORD and = 0, xor = 0;
@ -1196,7 +1197,8 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
case R2_NOP:
break;
default:
ret = brush->rects( pdev, brush, &pdev->dib, clipped_rects.count, clipped_rects.rects, rop2 );
ret = brush->rects( pdev, brush, &pdev->dib, clipped_rects.count, clipped_rects.rects,
&dc->brush_org, rop2 );
break;
}
free_clipped_rects( &clipped_rects );

View File

@ -1773,7 +1773,7 @@ BOOL fill_with_pixel( DC *dc, dib_info *dib, DWORD pixel, int num, const RECT *r
* Fill a number of rectangles with the solid brush
*/
static BOOL solid_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
int num, const RECT *rects, INT rop)
int num, const RECT *rects, const POINT *brush_org, INT rop)
{
DC *dc = get_physdev_dc( &pdev->dev );
DWORD color = get_pixel_color( dc, &pdev->dib, brush->colorref, TRUE );
@ -2005,9 +2005,8 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, dib_brush *brush, BOOL *
* FIXME: Should we insist l < r && t < b? Currently we assume this.
*/
static BOOL pattern_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
int num, const RECT *rects, INT rop)
int num, const RECT *rects, const POINT *brush_org, INT rop)
{
DC *dc = get_physdev_dc( &pdev->dev );
BOOL needs_reselect = FALSE;
if (rop != brush->rop)
@ -2043,14 +2042,14 @@ static BOOL pattern_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
}
}
dib->funcs->pattern_rects( dib, num, rects, &dc->brush_org, &brush->dib, &brush->masks );
dib->funcs->pattern_rects( dib, num, rects, brush_org, &brush->dib, &brush->masks );
if (needs_reselect) free_pattern_brush( brush );
return TRUE;
}
static BOOL null_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
int num, const RECT *rects, INT rop)
int num, const RECT *rects, const POINT *brush_org, INT rop)
{
return TRUE;
}