Commit 9ea45ac6 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Use the original unclipped coordinates for XRender blits to avoid rounding errors.

parent c2edf439
...@@ -2336,10 +2336,10 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr ...@@ -2336,10 +2336,10 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
Drawable drawable, const struct bitblt_coords *src, Drawable drawable, const struct bitblt_coords *src,
const struct bitblt_coords *dst ) const struct bitblt_coords *dst )
{ {
int width = dst->visrect.right - dst->visrect.left; int width = abs( dst->width );
int height = dst->visrect.bottom - dst->visrect.top; int height = abs( dst->height );
int x_src = physdev_src->x11dev->dc_rect.left + src->visrect.left; int x_src = physdev_src->x11dev->dc_rect.left + src->x;
int y_src = physdev_src->x11dev->dc_rect.top + src->visrect.top; int y_src = physdev_src->x11dev->dc_rect.top + src->y;
int x_dst, y_dst; int x_dst, y_dst;
Picture src_pict = 0, dst_pict, mask_pict = 0; Picture src_pict = 0, dst_pict, mask_pict = 0;
BOOL use_repeat; BOOL use_repeat;
...@@ -2357,7 +2357,8 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr ...@@ -2357,7 +2357,8 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
{ {
XRenderPictureAttributes pa; XRenderPictureAttributes pa;
x_dst = y_dst = 0; x_dst = dst->x;
y_dst = dst->y;
pa.repeat = RepeatNone; pa.repeat = RepeatNone;
wine_tsx11_lock(); wine_tsx11_lock();
dst_pict = pXRenderCreatePicture( gdi_display, drawable, physdev_dst->pict_format, CPRepeat, &pa ); dst_pict = pXRenderCreatePicture( gdi_display, drawable, physdev_dst->pict_format, CPRepeat, &pa );
...@@ -2365,11 +2366,16 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr ...@@ -2365,11 +2366,16 @@ static void xrender_stretch_blit( struct xrender_physdev *physdev_src, struct xr
} }
else else
{ {
x_dst = physdev_dst->x11dev->dc_rect.left + dst->visrect.left; x_dst = physdev_dst->x11dev->dc_rect.left + dst->x;
y_dst = physdev_dst->x11dev->dc_rect.top + dst->visrect.top; y_dst = physdev_dst->x11dev->dc_rect.top + dst->y;
dst_pict = get_xrender_picture( physdev_dst ); dst_pict = get_xrender_picture( physdev_dst );
} }
if (src->width < 0) x_src += src->width + 1;
if (src->height < 0) y_src += src->height + 1;
if (dst->width < 0) x_dst += dst->width + 1;
if (dst->height < 0) y_dst += dst->height + 1;
/* mono -> color */ /* mono -> color */
if (physdev_src->format == WXR_FORMAT_MONO && physdev_dst->format != WXR_FORMAT_MONO) if (physdev_src->format == WXR_FORMAT_MONO && physdev_dst->format != WXR_FORMAT_MONO)
{ {
...@@ -2463,16 +2469,23 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst, ...@@ -2463,16 +2469,23 @@ static BOOL xrenderdrv_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
{ {
GC tmpGC; GC tmpGC;
Pixmap tmp_pixmap; Pixmap tmp_pixmap;
struct bitblt_coords tmp;
/* make coordinates relative to tmp pixmap */
tmp = *dst;
tmp.x -= tmp.visrect.left;
tmp.y -= tmp.visrect.top;
OffsetRect( &tmp.visrect, -tmp.visrect.left, -tmp.visrect.top );
wine_tsx11_lock(); wine_tsx11_lock();
tmpGC = XCreateGC( gdi_display, physdev_dst->x11dev->drawable, 0, NULL ); tmpGC = XCreateGC( gdi_display, physdev_dst->x11dev->drawable, 0, NULL );
XSetSubwindowMode( gdi_display, tmpGC, IncludeInferiors ); XSetSubwindowMode( gdi_display, tmpGC, IncludeInferiors );
XSetGraphicsExposures( gdi_display, tmpGC, False ); XSetGraphicsExposures( gdi_display, tmpGC, False );
tmp_pixmap = XCreatePixmap( gdi_display, root_window, dst->visrect.right - dst->visrect.left, tmp_pixmap = XCreatePixmap( gdi_display, root_window, tmp.visrect.right - tmp.visrect.left,
dst->visrect.bottom - dst->visrect.top, physdev_dst->x11dev->depth ); tmp.visrect.bottom - tmp.visrect.top, physdev_dst->x11dev->depth );
wine_tsx11_unlock(); wine_tsx11_unlock();
xrender_stretch_blit( physdev_src, physdev_dst, tmp_pixmap, src, dst ); xrender_stretch_blit( physdev_src, physdev_dst, tmp_pixmap, src, &tmp );
execute_rop( physdev_dst->x11dev, tmp_pixmap, tmpGC, &dst->visrect, rop ); execute_rop( physdev_dst->x11dev, tmp_pixmap, tmpGC, &dst->visrect, rop );
wine_tsx11_lock(); wine_tsx11_lock();
...@@ -2547,12 +2560,11 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst, ...@@ -2547,12 +2560,11 @@ static BOOL xrenderdrv_AlphaBlend( PHYSDEV dst_dev, struct bitblt_coords *dst,
wine_tsx11_lock(); wine_tsx11_lock();
xrender_blit( PictOpOver, src_pict, mask_pict, dst_pict, xrender_blit( PictOpOver, src_pict, mask_pict, dst_pict,
physdev_src->x11dev->dc_rect.left + src->visrect.left, physdev_src->x11dev->dc_rect.left + src->x,
physdev_src->x11dev->dc_rect.top + src->visrect.top, physdev_src->x11dev->dc_rect.top + src->y,
physdev_dst->x11dev->dc_rect.left + dst->visrect.left, physdev_dst->x11dev->dc_rect.left + dst->x,
physdev_dst->x11dev->dc_rect.top + dst->visrect.top, physdev_dst->x11dev->dc_rect.top + dst->y,
xscale, yscale, xscale, yscale, dst->width, dst->height );
dst->visrect.right - dst->visrect.left, dst->visrect.bottom - dst->visrect.top );
if (tmp_pict) pXRenderFreePicture( gdi_display, tmp_pict ); if (tmp_pict) pXRenderFreePicture( gdi_display, tmp_pict );
wine_tsx11_unlock(); wine_tsx11_unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment