gdi32: Pass the brush origin explicitly to the brush backend functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b491635f0a
commit
97a9db43d2
|
@ -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,
|
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;
|
dib_info *dibs[3], *result = src, tmp;
|
||||||
RECT rects[3];
|
RECT rects[3];
|
||||||
|
@ -784,10 +785,10 @@ static DWORD execute_rop( dibdrv_physdev *pdev, const RECT *dst_rect, dib_info *
|
||||||
break;
|
break;
|
||||||
case OP_ARGS(PAT,DST):
|
case OP_ARGS(PAT,DST):
|
||||||
pdev->brush.rects( pdev, &pdev->brush, dibs[DST], clipped_rects->count, clipped_rects->rects,
|
pdev->brush.rects( pdev, &pdev->brush, dibs[DST], clipped_rects->count, clipped_rects->rects,
|
||||||
OP_ROP(*opcode) );
|
brush_org, OP_ROP(*opcode) );
|
||||||
break;
|
break;
|
||||||
case OP_ARGS(PAT,SRC):
|
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;
|
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 );
|
mask_rect( &pdev->dib, &dst->visrect, &src_dib, &src->visrect, &clipped_rects, rop2 );
|
||||||
}
|
}
|
||||||
else
|
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 );
|
free_clipped_rects( &clipped_rects );
|
||||||
}
|
}
|
||||||
if (tmp_rgn) DeleteObject( tmp_rgn );
|
if (tmp_rgn) DeleteObject( tmp_rgn );
|
||||||
|
|
|
@ -75,7 +75,7 @@ typedef struct dib_brush
|
||||||
rop_mask_bits masks;
|
rop_mask_bits masks;
|
||||||
struct brush_pattern pattern;
|
struct brush_pattern pattern;
|
||||||
BOOL (*rects)(struct dibdrv_physdev *pdev, struct dib_brush *brush, dib_info *dib,
|
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;
|
} dib_brush;
|
||||||
|
|
||||||
struct intensity_range
|
struct intensity_range
|
||||||
|
|
|
@ -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;
|
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,
|
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 );
|
free_clipped_rects( &clipped_rects );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1174,6 +1174,7 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
|
||||||
{
|
{
|
||||||
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
|
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
|
||||||
dib_brush *brush = &pdev->brush;
|
dib_brush *brush = &pdev->brush;
|
||||||
|
DC *dc = get_physdev_dc( dev );
|
||||||
int rop2 = get_rop2_from_rop( rop );
|
int rop2 = get_rop2_from_rop( rop );
|
||||||
struct clipped_rects clipped_rects;
|
struct clipped_rects clipped_rects;
|
||||||
DWORD and = 0, xor = 0;
|
DWORD and = 0, xor = 0;
|
||||||
|
@ -1196,7 +1197,8 @@ BOOL dibdrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
|
||||||
case R2_NOP:
|
case R2_NOP:
|
||||||
break;
|
break;
|
||||||
default:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
free_clipped_rects( &clipped_rects );
|
free_clipped_rects( &clipped_rects );
|
||||||
|
|
|
@ -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
|
* Fill a number of rectangles with the solid brush
|
||||||
*/
|
*/
|
||||||
static BOOL solid_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
|
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 );
|
DC *dc = get_physdev_dc( &pdev->dev );
|
||||||
DWORD color = get_pixel_color( dc, &pdev->dib, brush->colorref, TRUE );
|
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.
|
* 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,
|
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;
|
BOOL needs_reselect = FALSE;
|
||||||
|
|
||||||
if (rop != brush->rop)
|
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 );
|
if (needs_reselect) free_pattern_brush( brush );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL null_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue