winex11.drv: Store window and drawable rects in X11DRV_PDEVICE.

This commit is contained in:
Ulrich Czekalla 2006-12-07 10:43:59 -05:00 committed by Alexandre Julliard
parent e7b9a5f166
commit 4bdf4345b8
14 changed files with 224 additions and 205 deletions

View file

@ -876,8 +876,8 @@ static int BITBLT_GetSrcAreaStretch( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
get_colors(physDevDst, physDevSrc, &fg, &bg);
/* FIXME: avoid BadMatch errors */
imageSrc = XGetImage( gdi_display, physDevSrc->drawable,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
visRectSrc->right - visRectSrc->left,
visRectSrc->bottom - visRectSrc->top,
AllPlanes, ZPixmap );
@ -926,14 +926,14 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
XSetBackground( gdi_display, gc, physDevDst->textPixel );
XSetForeground( gdi_display, gc, physDevDst->backgroundPixel );
XCopyPlane( gdi_display, physDevSrc->drawable, pixmap, gc,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, 0, 0, 1);
}
else
XCopyArea( gdi_display, physDevSrc->drawable, pixmap, gc,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, 0, 0);
exposures++;
}
@ -941,15 +941,15 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
{
if (GetObjectType(physDevSrc->hdc) == OBJ_MEMDC)
imageSrc = XGetImage( gdi_display, physDevSrc->drawable,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, AllPlanes, ZPixmap );
else
{
/* Make sure we don't get a BadMatch error */
XCopyArea( gdi_display, physDevSrc->drawable, pixmap, gc,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, 0, 0);
exposures++;
imageSrc = XGetImage( gdi_display, pixmap, 0, 0, width, height,
@ -983,8 +983,8 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
XSetForeground( gdi_display, gc, bg );
}
XCopyPlane( gdi_display, physDevSrc->drawable, pixmap, gc,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, 0, 0, 1 );
exposures++;
}
@ -992,8 +992,8 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
{
/* FIXME: avoid BadMatch error */
imageSrc = XGetImage( gdi_display, physDevSrc->drawable,
physDevSrc->org.x + visRectSrc->left,
physDevSrc->org.y + visRectSrc->top,
physDevSrc->dc_rect.left + visRectSrc->left,
physDevSrc->dc_rect.top + visRectSrc->top,
width, height, AllPlanes, ZPixmap );
if (!imageSrc)
{
@ -1035,7 +1035,7 @@ static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( gdi_display, physDev->drawable, pixmap, gc,
physDev->org.x + visRectDst->left, physDev->org.y + visRectDst->top,
physDev->dc_rect.left + visRectDst->left, physDev->dc_rect.top + visRectDst->top,
width, height, 0, 0 );
exposures++;
}
@ -1046,15 +1046,15 @@ static int BITBLT_GetDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, GC gc, RECT
if (GetObjectType( physDev->hdc ) == OBJ_MEMDC)
image = XGetImage( gdi_display, physDev->drawable,
physDev->org.x + visRectDst->left,
physDev->org.y + visRectDst->top,
physDev->dc_rect.left + visRectDst->left,
physDev->dc_rect.top + visRectDst->top,
width, height, AllPlanes, ZPixmap );
else
{
/* Make sure we don't get a BadMatch error */
XCopyArea( gdi_display, physDev->drawable, pixmap, gc,
physDev->org.x + visRectDst->left,
physDev->org.y + visRectDst->top,
physDev->dc_rect.left + visRectDst->left,
physDev->dc_rect.top + visRectDst->top,
width, height, 0, 0);
exposures++;
image = XGetImage( gdi_display, pixmap, 0, 0, width, height,
@ -1089,8 +1089,8 @@ static int BITBLT_PutDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, RECT *visRe
(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) )
{
XCopyArea( gdi_display, pixmap, physDev->drawable, physDev->gc, 0, 0, width, height,
physDev->org.x + visRectDst->left,
physDev->org.y + visRectDst->top );
physDev->dc_rect.left + visRectDst->left,
physDev->dc_rect.top + visRectDst->top );
exposures++;
}
else
@ -1105,8 +1105,8 @@ static int BITBLT_PutDstArea(X11DRV_PDEVICE *physDev, Pixmap pixmap, RECT *visRe
X11DRV_PALETTE_PaletteToXPixel[XGetPixel( image, x, y )]);
}
XPutImage( gdi_display, physDev->drawable, physDev->gc, image, 0, 0,
physDev->org.x + visRectDst->left,
physDev->org.y + visRectDst->top, width, height );
physDev->dc_rect.left + visRectDst->left,
physDev->dc_rect.top + visRectDst->top, width, height );
XDestroyImage( image );
}
return exposures;
@ -1259,7 +1259,7 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
TRACE(" rectdst=%d,%d-%d,%d orgdst=%d,%d\n",
xDst, yDst, widthDst, heightDst,
physDevDst->org.x, physDevDst->org.y );
physDevDst->dc_rect.left, physDevDst->dc_rect.top );
if (useSrc)
{
@ -1276,7 +1276,7 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
fStretch = (widthSrc != widthDst) || (heightSrc != heightDst);
TRACE(" rectsrc=%d,%d-%d,%d orgsrc=%d,%d\n",
xSrc, ySrc, widthSrc, heightSrc,
physDevSrc->org.x, physDevSrc->org.y );
physDevSrc->dc_rect.left, physDevSrc->dc_rect.top );
if (!BITBLT_GetVisRectangles( physDevDst, xDst, yDst, widthDst, heightDst,
physDevSrc, xSrc, ySrc, widthSrc, heightSrc,
&visRectSrc, &visRectDst ))
@ -1314,8 +1314,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
XSetFillStyle( gdi_display, physDevDst->gc, FillSolid );
}
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
return TRUE;
@ -1338,8 +1338,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
XSetFillStyle( gdi_display, physDevDst->gc, FillSolid );
}
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
return TRUE;
@ -1350,8 +1350,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
wine_tsx11_lock();
XSetFunction( gdi_display, physDevDst->gc, GXxor );
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
}
@ -1363,8 +1363,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
wine_tsx11_lock();
XSetFunction( gdi_display, physDevDst->gc, GXequiv );
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
}
@ -1377,11 +1377,11 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
XSetFunction( gdi_display, physDevDst->gc, GXcopy );
XCopyArea( gdi_display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc,
physDevSrc->org.x + visRectSrc.left,
physDevSrc->org.y + visRectSrc.top,
physDevSrc->dc_rect.left + visRectSrc.left,
physDevSrc->dc_rect.top + visRectSrc.top,
width, height,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top );
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top );
physDevDst->exposures++;
wine_tsx11_unlock();
return TRUE;
@ -1398,11 +1398,11 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
XSetFunction( gdi_display, physDevDst->gc, GXcopy );
XCopyPlane( gdi_display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc,
physDevSrc->org.x + visRectSrc.left,
physDevSrc->org.y + visRectSrc.top,
physDevSrc->dc_rect.left + visRectSrc.left,
physDevSrc->dc_rect.top + visRectSrc.top,
width, height,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top, 1 );
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top, 1 );
physDevDst->exposures++;
wine_tsx11_unlock();
return TRUE;
@ -1414,8 +1414,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
wine_tsx11_lock();
XSetFunction( gdi_display, physDevDst->gc, GXcopy );
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
return TRUE;
@ -1432,8 +1432,8 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT
XSetFillStyle( gdi_display, physDevDst->gc, FillSolid );
}
XFillRectangle( gdi_display, physDevDst->drawable, physDevDst->gc,
physDevDst->org.x + visRectDst.left,
physDevDst->org.y + visRectDst.top,
physDevDst->dc_rect.left + visRectDst.left,
physDevDst->dc_rect.top + visRectDst.top,
width, height );
wine_tsx11_unlock();
return TRUE;

View file

@ -115,7 +115,7 @@ void X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_
if (!(data = X11DRV_GetRegionData( physDev->region, 0 ))) return;
wine_tsx11_lock();
XSetClipRectangles( gdi_display, physDev->gc, physDev->org.x, physDev->org.y,
XSetClipRectangles( gdi_display, physDev->gc, physDev->dc_rect.left, physDev->dc_rect.top,
(XRectangle *)data->Buffer, data->rdh.nCount, YXBanded );
wine_tsx11_unlock();
HeapFree( GetProcessHeap(), 0, data );

View file

@ -126,10 +126,14 @@ static void update_visible_region( struct dce *dce )
vis_rgn = ExtCreateRegion( NULL, size, data );
top = reply->top_win;
escape.org.x = reply->win_org_x - reply->top_org_x;
escape.org.y = reply->win_org_y - reply->top_org_y;
escape.drawable_org.x = reply->top_org_x;
escape.drawable_org.y = reply->top_org_y;
escape.dc_rect.left = reply->win_rect.left - reply->top_rect.left;
escape.dc_rect.top = reply->win_rect.top - reply->top_rect.top;
escape.dc_rect.right = reply->win_rect.right - reply->top_rect.left;
escape.dc_rect.bottom = reply->win_rect.bottom - reply->top_rect.top;
escape.drawable_rect.left = reply->top_rect.left;
escape.drawable_rect.top = reply->top_rect.top;
escape.drawable_rect.right = reply->top_rect.right;
escape.drawable_rect.bottom = reply->top_rect.bottom;
}
else size = reply->total_size;
}
@ -154,8 +158,8 @@ static void update_visible_region( struct dce *dce )
/* map region to DC coordinates */
OffsetRgn( vis_rgn,
-(escape.drawable_org.x + escape.org.x),
-(escape.drawable_org.y + escape.org.y) );
-(escape.drawable_rect.left + escape.dc_rect.left),
-(escape.drawable_rect.top + escape.dc_rect.top) );
SelectVisRgn16( HDC_16(dce->hdc), HRGN_16(vis_rgn) );
DeleteObject( vis_rgn );
}
@ -178,8 +182,9 @@ static void release_dce( struct dce *dce )
escape.code = X11DRV_SET_DRAWABLE;
escape.drawable = root_window;
escape.mode = IncludeInferiors;
escape.org.x = escape.org.y = 0;
escape.drawable_org.x = escape.drawable_org.y = 0;
escape.drawable_rect = virtual_screen_rect;
SetRect( &escape.dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top );
ExtEscape( dce->hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
}

View file

@ -3462,7 +3462,7 @@ static void X11DRV_DIB_SetImageBits_GetSubImage(
descr->xDest + descr->width , descr->yDest + descr->height );
GetRgnBox( descr->physDev->region, &rc );
/* convert from dc to drawable origin */
OffsetRect( &rc, descr->physDev->org.x, descr->physDev->org.y);
OffsetRect( &rc, descr->physDev->dc_rect.left, descr->physDev->dc_rect.top);
/* clip visible rect with bitmap */
if( IntersectRect( &rc, &rc, &bmprc))
{
@ -3833,8 +3833,8 @@ INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWO
descr.gc = physDev->gc;
descr.xSrc = xSrc;
descr.ySrc = ySrc;
descr.xDest = physDev->org.x + pt.x;
descr.yDest = physDev->org.y + pt.y;
descr.xDest = physDev->dc_rect.left + pt.x;
descr.yDest = physDev->dc_rect.top + pt.y;
descr.width = cx;
descr.height = cy;
descr.useShm = FALSE;
@ -4229,7 +4229,7 @@ void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physD
/* perform the copy */
X11DRV_DIB_DoCopyDIBSection(physBitmap, FALSE, colorMap, nColorMap,
physDevDst->drawable, physDevDst->gc, xSrc, ySrc,
physDevDst->org.x + xDest, physDevDst->org.y + yDest,
physDevDst->dc_rect.left + xDest, physDevDst->dc_rect.top + yDest,
width, height);
/* free color mapping */
if (aColorMap)

View file

@ -149,8 +149,8 @@ BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
break;
}
GetBrushOrgEx( physDev->hdc, &pt );
val.ts_x_origin = physDev->org.x + pt.x;
val.ts_y_origin = physDev->org.y + pt.y;
val.ts_x_origin = physDev->dc_rect.left + pt.x;
val.ts_y_origin = physDev->dc_rect.top + pt.y;
val.fill_rule = (GetPolyFillMode(physDev->hdc) == WINDING) ? WindingRule : EvenOddRule;
wine_tsx11_lock();
XChangeGC( gdi_display, gc,
@ -342,8 +342,8 @@ X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y )
wine_tsx11_lock();
XDrawLine(gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + pt[0].x, physDev->org.y + pt[0].y,
physDev->org.x + pt[1].x, physDev->org.y + pt[1].y );
physDev->dc_rect.left + pt[0].x, physDev->dc_rect.top + pt[0].y,
physDev->dc_rect.left + pt[1].x, physDev->dc_rect.top + pt[1].y );
wine_tsx11_unlock();
/* Update the DIBSection from the pixmap */
@ -437,7 +437,7 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
wine_tsx11_lock();
XSetArcMode( gdi_display, physDev->gc, (lines==1) ? ArcChord : ArcPieSlice);
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1, istart_angle, idiff_angle );
wine_tsx11_unlock();
update = TRUE;
@ -449,20 +449,20 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
{
wine_tsx11_lock();
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1, istart_angle, idiff_angle );
if (lines) {
/* use the truncated values */
start_angle=(double)istart_angle*PI/64./180.;
end_angle=(double)(istart_angle+idiff_angle)*PI/64./180.;
/* calculate the endpoints and round correctly */
points[0].x = (int) floor(physDev->org.x + (rc.right+rc.left)/2.0 +
points[0].x = (int) floor(physDev->dc_rect.left + (rc.right+rc.left)/2.0 +
cos(start_angle) * (rc.right-rc.left-width*2+2) / 2. + 0.5);
points[0].y = (int) floor(physDev->org.y + (rc.top+rc.bottom)/2.0 -
points[0].y = (int) floor(physDev->dc_rect.top + (rc.top+rc.bottom)/2.0 -
sin(start_angle) * (rc.bottom-rc.top-width*2+2) / 2. + 0.5);
points[1].x = (int) floor(physDev->org.x + (rc.right+rc.left)/2.0 +
points[1].x = (int) floor(physDev->dc_rect.left + (rc.right+rc.left)/2.0 +
cos(end_angle) * (rc.right-rc.left-width*2+2) / 2. + 0.5);
points[1].y = (int) floor(physDev->org.y + (rc.top+rc.bottom)/2.0 -
points[1].y = (int) floor(physDev->dc_rect.top + (rc.top+rc.bottom)/2.0 -
sin(end_angle) * (rc.bottom-rc.top-width*2+2) / 2. + 0.5);
/* OK, this stuff is optimized for Xfree86
@ -476,8 +476,8 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
if (lines == 2) {
INT dx1,dy1;
points[3] = points[1];
points[1].x = physDev->org.x + xcenter;
points[1].y = physDev->org.y + ycenter;
points[1].x = physDev->dc_rect.left + xcenter;
points[1].y = physDev->dc_rect.top + ycenter;
points[2] = points[1];
dx1=points[1].x-points[0].x;
dy1=points[1].y-points[0].y;
@ -595,7 +595,7 @@ X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT botto
{
wine_tsx11_lock();
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1, 0, 360*64 );
wine_tsx11_unlock();
update = TRUE;
@ -604,7 +604,7 @@ X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT botto
{
wine_tsx11_lock();
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1, 0, 360*64 );
wine_tsx11_unlock();
update = TRUE;
@ -666,8 +666,8 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott
{
wine_tsx11_lock();
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + (width + 1) / 2,
physDev->org.y + rc.top + (width + 1) / 2,
physDev->dc_rect.left + rc.left + (width + 1) / 2,
physDev->dc_rect.top + rc.top + (width + 1) / 2,
rc.right-rc.left-width-1, rc.bottom-rc.top-width-1);
wine_tsx11_unlock();
update = TRUE;
@ -677,7 +677,7 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott
{
wine_tsx11_lock();
XDrawRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right-rc.left-1, rc.bottom-rc.top-1 );
wine_tsx11_unlock();
update = TRUE;
@ -753,61 +753,61 @@ X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
if (ell_width > (rc.right-rc.left) )
if (ell_height > (rc.bottom-rc.top) )
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right - rc.left - 1, rc.bottom - rc.top - 1,
0, 360 * 64 );
else{
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right - rc.left - 1, ell_height, 0, 180 * 64 );
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left,
physDev->org.y + rc.bottom - ell_height - 1,
physDev->dc_rect.left + rc.left,
physDev->dc_rect.top + rc.bottom - ell_height - 1,
rc.right - rc.left - 1, ell_height, 180 * 64,
180 * 64 );
}
else if (ell_height > (rc.bottom-rc.top) ){
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
ell_width, rc.bottom - rc.top - 1, 90 * 64, 180 * 64 );
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width - 1, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.right - ell_width - 1, physDev->dc_rect.top + rc.top,
ell_width, rc.bottom - rc.top - 1, 270 * 64, 180 * 64 );
}else{
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
ell_width, ell_height, 90 * 64, 90 * 64 );
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left,
physDev->org.y + rc.bottom - ell_height - 1,
physDev->dc_rect.left + rc.left,
physDev->dc_rect.top + rc.bottom - ell_height - 1,
ell_width, ell_height, 180 * 64, 90 * 64 );
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width - 1,
physDev->org.y + rc.bottom - ell_height - 1,
physDev->dc_rect.left + rc.right - ell_width - 1,
physDev->dc_rect.top + rc.bottom - ell_height - 1,
ell_width, ell_height, 270 * 64, 90 * 64 );
XFillArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width - 1,
physDev->org.y + rc.top,
physDev->dc_rect.left + rc.right - ell_width - 1,
physDev->dc_rect.top + rc.top,
ell_width, ell_height, 0, 90 * 64 );
}
if (ell_width < rc.right - rc.left)
{
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + (ell_width + 1) / 2,
physDev->org.y + rc.top + 1,
physDev->dc_rect.left + rc.left + (ell_width + 1) / 2,
physDev->dc_rect.top + rc.top + 1,
rc.right - rc.left - ell_width - 1,
(ell_height + 1) / 2 - 1);
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + (ell_width + 1) / 2,
physDev->org.y + rc.bottom - (ell_height) / 2 - 1,
physDev->dc_rect.left + rc.left + (ell_width + 1) / 2,
physDev->dc_rect.top + rc.bottom - (ell_height) / 2 - 1,
rc.right - rc.left - ell_width - 1,
(ell_height) / 2 );
}
if (ell_height < rc.bottom - rc.top)
{
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + 1,
physDev->org.y + rc.top + (ell_height + 1) / 2,
physDev->dc_rect.left + rc.left + 1,
physDev->dc_rect.top + rc.top + (ell_height + 1) / 2,
rc.right - rc.left - 2,
rc.bottom - rc.top - ell_height - 1);
}
@ -827,65 +827,65 @@ X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right,
if (ell_width > (rc.right-rc.left) )
if (ell_height > (rc.bottom-rc.top) )
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right - rc.left - 1, rc.bottom - rc.top - 1, 0 , 360 * 64 );
else{
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
rc.right - rc.left - 1, ell_height - 1, 0 , 180 * 64 );
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left,
physDev->org.y + rc.bottom - ell_height,
physDev->dc_rect.left + rc.left,
physDev->dc_rect.top + rc.bottom - ell_height,
rc.right - rc.left - 1, ell_height - 1, 180 * 64 , 180 * 64 );
}
else if (ell_height > (rc.bottom-rc.top) ){
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
ell_width - 1 , rc.bottom - rc.top - 1, 90 * 64 , 180 * 64 );
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width,
physDev->org.y + rc.top,
physDev->dc_rect.left + rc.right - ell_width,
physDev->dc_rect.top + rc.top,
ell_width - 1 , rc.bottom - rc.top - 1, 270 * 64 , 180 * 64 );
}else{
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.top,
ell_width - 1, ell_height - 1, 90 * 64, 90 * 64 );
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left, physDev->org.y + rc.bottom - ell_height,
physDev->dc_rect.left + rc.left, physDev->dc_rect.top + rc.bottom - ell_height,
ell_width - 1, ell_height - 1, 180 * 64, 90 * 64 );
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width,
physDev->org.y + rc.bottom - ell_height,
physDev->dc_rect.left + rc.right - ell_width,
physDev->dc_rect.top + rc.bottom - ell_height,
ell_width - 1, ell_height - 1, 270 * 64, 90 * 64 );
XDrawArc( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - ell_width, physDev->org.y + rc.top,
physDev->dc_rect.left + rc.right - ell_width, physDev->dc_rect.top + rc.top,
ell_width - 1, ell_height - 1, 0, 90 * 64 );
}
if (ell_width < rc.right - rc.left)
{
XDrawLine( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + ell_width / 2,
physDev->org.y + rc.top,
physDev->org.x + rc.right - (ell_width+1) / 2,
physDev->org.y + rc.top);
physDev->dc_rect.left + rc.left + ell_width / 2,
physDev->dc_rect.top + rc.top,
physDev->dc_rect.left + rc.right - (ell_width+1) / 2,
physDev->dc_rect.top + rc.top);
XDrawLine( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left + ell_width / 2 ,
physDev->org.y + rc.bottom - 1,
physDev->org.x + rc.right - (ell_width+1)/ 2,
physDev->org.y + rc.bottom - 1);
physDev->dc_rect.left + rc.left + ell_width / 2 ,
physDev->dc_rect.top + rc.bottom - 1,
physDev->dc_rect.left + rc.right - (ell_width+1)/ 2,
physDev->dc_rect.top + rc.bottom - 1);
}
if (ell_height < rc.bottom - rc.top)
{
XDrawLine( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.right - 1,
physDev->org.y + rc.top + ell_height / 2,
physDev->org.x + rc.right - 1,
physDev->org.y + rc.bottom - (ell_height+1) / 2);
physDev->dc_rect.left + rc.right - 1,
physDev->dc_rect.top + rc.top + ell_height / 2,
physDev->dc_rect.left + rc.right - 1,
physDev->dc_rect.top + rc.bottom - (ell_height+1) / 2);
XDrawLine( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + rc.left,
physDev->org.y + rc.top + ell_height / 2,
physDev->org.x + rc.left,
physDev->org.y + rc.bottom - (ell_height+1) / 2);
physDev->dc_rect.left + rc.left,
physDev->dc_rect.top + rc.top + ell_height / 2,
physDev->dc_rect.left + rc.left,
physDev->dc_rect.top + rc.bottom - (ell_height+1) / 2);
}
update = TRUE;
}
@ -921,7 +921,7 @@ X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color )
XSetForeground( gdi_display, physDev->gc, pixel );
XSetFunction( gdi_display, physDev->gc, GXcopy );
XDrawPoint( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + pt.x, physDev->org.y + pt.y );
physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y );
wine_tsx11_unlock();
/* Update the DIBSection from the pixmap */
@ -954,7 +954,7 @@ X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y )
if (memdc)
{
image = XGetImage( gdi_display, physDev->drawable,
physDev->org.x + pt.x, physDev->org.y + pt.y,
physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y,
1, 1, AllPlanes, ZPixmap );
}
else
@ -964,7 +964,7 @@ X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y )
if (!pixmap) pixmap = XCreatePixmap( gdi_display, root_window,
1, 1, physDev->depth );
XCopyArea( gdi_display, physDev->drawable, pixmap, BITMAP_colorGC,
physDev->org.x + pt.x, physDev->org.y + pt.y, 1, 1, 0, 0 );
physDev->dc_rect.left + pt.x, physDev->dc_rect.top + pt.y, 1, 1, 0, 0 );
image = XGetImage( gdi_display, pixmap, 0, 0, 1, 1, AllPlanes, ZPixmap );
}
pixel = XGetPixel( image, 0, 0 );
@ -994,8 +994,8 @@ X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn )
rect = (XRectangle *)data->Buffer;
for (i = 0; i < data->rdh.nCount; i++)
{
rect[i].x += physDev->org.x;
rect[i].y += physDev->org.y;
rect[i].x += physDev->dc_rect.left;
rect[i].y += physDev->dc_rect.top;
}
X11DRV_LockDIBSection(physDev, DIB_Status_GdiMod, FALSE);
@ -1026,8 +1026,8 @@ X11DRV_Polyline( X11DRV_PDEVICE *physDev, const POINT* pt, INT count )
{
POINT tmp = pt[i];
LPtoDP(physDev->hdc, &tmp, 1);
points[i].x = physDev->org.x + tmp.x;
points[i].y = physDev->org.y + tmp.y;
points[i].x = physDev->dc_rect.left + tmp.x;
points[i].y = physDev->dc_rect.top + tmp.y;
}
if (X11DRV_SetupGCForPen ( physDev ))
@ -1064,8 +1064,8 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count )
{
POINT tmp = pt[i];
LPtoDP(physDev->hdc, &tmp, 1);
points[i].x = physDev->org.x + tmp.x;
points[i].y = physDev->org.y + tmp.y;
points[i].x = physDev->dc_rect.left + tmp.x;
points[i].y = physDev->dc_rect.top + tmp.y;
}
points[count] = points[0];
@ -1135,8 +1135,8 @@ X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts,
{
POINT tmp = *pt;
LPtoDP(physDev->hdc, &tmp, 1);
points[j].x = physDev->org.x + tmp.x;
points[j].y = physDev->org.y + tmp.y;
points[j].x = physDev->dc_rect.left + tmp.x;
points[j].y = physDev->dc_rect.top + tmp.y;
pt++;
}
points[j] = points[0];
@ -1181,8 +1181,8 @@ X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* coun
{
POINT tmp = *pt;
LPtoDP(physDev->hdc, &tmp, 1);
points[j].x = physDev->org.x + tmp.x;
points[j].y = physDev->org.y + tmp.y;
points[j].x = physDev->dc_rect.left + tmp.x;
points[j].y = physDev->dc_rect.top + tmp.y;
pt++;
}
wine_tsx11_lock();
@ -1296,7 +1296,7 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color,
wine_tsx11_lock();
X11DRV_expect_error( gdi_display, ExtFloodFillXGetImageErrorHandler, NULL );
image = XGetImage( gdi_display, physDev->drawable,
physDev->org.x + rect.left, physDev->org.y + rect.top,
physDev->dc_rect.left + rect.left, physDev->dc_rect.top + rect.top,
rect.right - rect.left, rect.bottom - rect.top,
AllPlanes, ZPixmap );
if(X11DRV_check_error()) image = NULL;
@ -1312,8 +1312,8 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color,
wine_tsx11_lock();
XSetFunction( gdi_display, physDev->gc, GXcopy );
X11DRV_InternalFloodFill(image, physDev,
physDev->org.x + pt.x - rect.left,
physDev->org.y + pt.y - rect.top,
physDev->dc_rect.left + pt.x - rect.left,
physDev->dc_rect.top + pt.y - rect.top,
rect.left, rect.top,
X11DRV_PALETTE_ToPhysical( physDev, color ),
fillType );
@ -1353,8 +1353,8 @@ X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color )
*/
BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp )
{
lpp->x = physDev->org.x + physDev->drawable_org.x;
lpp->y = physDev->org.y + physDev->drawable_org.y;
lpp->x = physDev->dc_rect.left + physDev->drawable_rect.left;
lpp->y = physDev->dc_rect.top + physDev->drawable_rect.top;
return TRUE;
}
@ -1364,9 +1364,9 @@ BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp )
*/
DWORD X11DRV_SetDCOrg( X11DRV_PDEVICE *physDev, INT x, INT y )
{
DWORD ret = MAKELONG( physDev->org.x + physDev->drawable_org.x,
physDev->org.y + physDev->drawable_org.y );
physDev->org.x = x - physDev->drawable_org.x;
physDev->org.y = y - physDev->drawable_org.y;
DWORD ret = MAKELONG( physDev->dc_rect.left + physDev->drawable_rect.left,
physDev->dc_rect.top + physDev->drawable_rect.top );
physDev->dc_rect.left = x - physDev->drawable_rect.left;
physDev->dc_rect.top = y - physDev->drawable_rect.top;
return ret;
}

View file

@ -327,9 +327,9 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
{
const struct x11drv_escape_set_drawable *data = (const struct x11drv_escape_set_drawable *)in_data;
if(physDev->xrender) X11DRV_XRender_UpdateDrawable( physDev );
physDev->org = data->org;
physDev->dc_rect = data->dc_rect;
physDev->drawable = data->drawable;
physDev->drawable_org = data->drawable_org;
physDev->drawable_rect = data->drawable_rect;
wine_tsx11_lock();
XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
wine_tsx11_unlock();
@ -359,8 +359,8 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
if (event.type == NoExpose) break;
if (event.type == GraphicsExpose)
{
int x = event.xgraphicsexpose.x - physDev->org.x;
int y = event.xgraphicsexpose.y - physDev->org.y;
int x = event.xgraphicsexpose.x - physDev->dc_rect.left;
int y = event.xgraphicsexpose.y - physDev->dc_rect.top;
TRACE( "got %d,%d %dx%d count %d\n", x, y,
event.xgraphicsexpose.width,

View file

@ -537,8 +537,8 @@ inline static void set_drawable( HDC hdc, Drawable drawable )
escape.code = X11DRV_SET_DRAWABLE;
escape.drawable = drawable;
escape.mode = IncludeInferiors;
escape.org.x = escape.org.y = 0;
escape.drawable_org.x = escape.drawable_org.y = 0;
ZeroMemory(&escape.dc_rect, sizeof(escape.dc_rect));
ZeroMemory(&escape.drawable_rect, sizeof(escape.drawable_rect));
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape, 0, NULL );
}

View file

@ -81,7 +81,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
wine_tsx11_lock();
XSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + lprect->left, physDev->org.y + lprect->top,
physDev->dc_rect.left + lprect->left, physDev->dc_rect.top + lprect->top,
lprect->right - lprect->left, lprect->bottom - lprect->top );
wine_tsx11_unlock();
}
@ -124,7 +124,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
{
X11DRV_cptable[pfo->fi->cptable].pDrawString(
pfo, gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + x, physDev->org.y + y, str2b, count );
physDev->dc_rect.left + x, physDev->dc_rect.top + y, str2b, count );
}
else
{
@ -145,7 +145,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
X11DRV_cptable[pfo->fi->cptable].pDrawText( pfo, gdi_display,
physDev->drawable, physDev->gc,
physDev->org.x + x, physDev->org.y + y, items, pitem - items );
physDev->dc_rect.left + x, physDev->dc_rect.top + y, items, pitem - items );
HeapFree( GetProcessHeap(), 0, items );
}
}
@ -159,9 +159,9 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
{
int char_metric_offset = str2b[i].byte2 + (str2b[i].byte1 << 8)
- font->min_char_or_byte2;
int x_i = IROUND((double) (physDev->org.x + x) + offset *
int x_i = IROUND((double) (physDev->dc_rect.left + x) + offset *
pfo->lpX11Trans->a / pfo->lpX11Trans->pixelsize );
int y_i = IROUND((double) (physDev->org.y + y) - offset *
int y_i = IROUND((double) (physDev->dc_rect.top + y) - offset *
pfo->lpX11Trans->b / pfo->lpX11Trans->pixelsize );
X11DRV_cptable[pfo->fi->cptable].pDrawString(

View file

@ -123,9 +123,9 @@ typedef struct
HDC hdc;
GC gc; /* X Window GC */
Drawable drawable;
POINT org; /* DC origin relative to drawable */
POINT drawable_org; /* Origin of drawable relative to screen */
HRGN region; /* Device region (visible region & clip region) */
RECT dc_rect; /* DC rectangle relative to drawable */
RECT drawable_rect; /* Drawable rectangle relative to screen */
HRGN region; /* Device region (visible region & clip region) */
X_PHYSFONT font;
X_PHYSPEN pen;
X_PHYSBRUSH brush;
@ -480,8 +480,8 @@ struct x11drv_escape_set_drawable
enum x11drv_escape_codes code; /* escape code (X11DRV_SET_DRAWABLE) */
Drawable drawable; /* X drawable */
int mode; /* ClipByChildren or IncludeInferiors */
POINT org; /* origin of DC relative to drawable */
POINT drawable_org; /* origin of drawable relative to screen */
RECT dc_rect; /* DC rectangle relative to drawable */
RECT drawable_rect;/* Drawable rectangle relative to screen */
};
struct x11drv_escape_set_dce

View file

@ -1118,7 +1118,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
wine_tsx11_lock();
XSetForeground( gdi_display, physDev->gc, backgroundPixel );
XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
physDev->org.x + lprect->left, physDev->org.y + lprect->top,
physDev->dc_rect.left + lprect->left, physDev->dc_rect.top + lprect->top,
lprect->right - lprect->left, lprect->bottom - lprect->top );
wine_tsx11_unlock();
}
@ -1175,7 +1175,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
{
wine_tsx11_lock();
pXRenderSetPictureClipRectangles( gdi_display, physDev->xrender->pict,
physDev->org.x, physDev->org.y,
physDev->dc_rect.left, physDev->dc_rect.top,
(XRectangle *)data->Buffer, data->rdh.nCount );
wine_tsx11_unlock();
HeapFree( GetProcessHeap(), 0, data );
@ -1261,7 +1261,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
assert(formatEntry);
TRACE("Writing %s at %d,%d\n", debugstr_wn(wstr,count),
physDev->org.x + x, physDev->org.y + y);
physDev->dc_rect.left + x, physDev->dc_rect.top + y);
if(X11DRV_XRender_Installed) {
wine_tsx11_lock();
@ -1270,7 +1270,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
physDev->xrender->tile_pict,
physDev->xrender->pict,
formatEntry->font_format, formatEntry->glyphset,
0, 0, physDev->org.x + x, physDev->org.y + y,
0, 0, physDev->dc_rect.left + x, physDev->dc_rect.top + y,
wstr, count);
else {
INT offset = 0, xoff = 0, yoff = 0;
@ -1279,8 +1279,8 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
physDev->xrender->tile_pict,
physDev->xrender->pict,
formatEntry->font_format, formatEntry->glyphset,
0, 0, physDev->org.x + x + xoff,
physDev->org.y + y + yoff,
0, 0, physDev->dc_rect.left + x + xoff,
physDev->dc_rect.top + y + yoff,
wstr + idx, 1);
offset += lpDx[idx];
xoff = offset * cosEsc;
@ -1296,8 +1296,8 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
if(antialias == AA_None) {
for(idx = 0; idx < count; idx++) {
SharpGlyphMono(physDev, physDev->org.x + x + xoff,
physDev->org.y + y + yoff,
SharpGlyphMono(physDev, physDev->dc_rect.left + x + xoff,
physDev->dc_rect.top + y + yoff,
formatEntry->bitmaps[wstr[idx]],
&formatEntry->gis[wstr[idx]]);
if(lpDx) {
@ -1311,8 +1311,8 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
} else if(physDev->depth == 1) {
for(idx = 0; idx < count; idx++) {
SharpGlyphGray(physDev, physDev->org.x + x + xoff,
physDev->org.y + y + yoff,
SharpGlyphGray(physDev, physDev->dc_rect.left + x + xoff,
physDev->dc_rect.top + y + yoff,
formatEntry->bitmaps[wstr[idx]],
&formatEntry->gis[wstr[idx]]);
if(lpDx) {
@ -1358,28 +1358,28 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
}
TRACE("glyph extents %d,%d - %d,%d drawable x,y %d,%d\n", extents.left, extents.top,
extents.right, extents.bottom, physDev->org.x + x, physDev->org.y + y);
extents.right, extents.bottom, physDev->dc_rect.left + x, physDev->dc_rect.top + y);
if(physDev->org.x + x + extents.left >= 0) {
image_x = physDev->org.x + x + extents.left;
if(physDev->dc_rect.left + x + extents.left >= 0) {
image_x = physDev->dc_rect.left + x + extents.left;
image_off_x = 0;
} else {
image_x = 0;
image_off_x = physDev->org.x + x + extents.left;
image_off_x = physDev->dc_rect.left + x + extents.left;
}
if(physDev->org.y + y + extents.top >= 0) {
image_y = physDev->org.y + y + extents.top;
if(physDev->dc_rect.top + y + extents.top >= 0) {
image_y = physDev->dc_rect.top + y + extents.top;
image_off_y = 0;
} else {
image_y = 0;
image_off_y = physDev->org.y + y + extents.top;
image_off_y = physDev->dc_rect.top + y + extents.top;
}
if(physDev->org.x + x + extents.right < w)
image_w = physDev->org.x + x + extents.right - image_x;
if(physDev->dc_rect.left + x + extents.right < w)
image_w = physDev->dc_rect.left + x + extents.right - image_x;
else
image_w = w - image_x;
if(physDev->org.y + y + extents.bottom < h)
image_h = physDev->org.y + y + extents.bottom - image_y;
if(physDev->dc_rect.top + y + extents.bottom < h)
image_h = physDev->dc_rect.top + y + extents.bottom - image_y;
else
image_h = h - image_y;
@ -1608,7 +1608,7 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
if ((rgndata = X11DRV_GetRegionData( devDst->region, 0 )))
{
pXRenderSetPictureClipRectangles( gdi_display, dst_pict,
devDst->org.x, devDst->org.y,
devDst->dc_rect.left, devDst->dc_rect.top,
(XRectangle *)rgndata->Buffer,
rgndata->rdh.nCount );
HeapFree( GetProcessHeap(), 0, rgndata );
@ -1628,7 +1628,7 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
#endif
pXRenderComposite(gdi_display, PictOpOver, src_pict, 0, dst_pict,
0, 0, 0, 0,
xDst + devDst->org.x, yDst + devDst->org.y, widthDst, heightDst);
xDst + devDst->dc_rect.left, yDst + devDst->dc_rect.top, widthDst, heightDst);
pXRenderFreePicture(gdi_display, src_pict);

View file

@ -2828,10 +2828,8 @@ struct get_visible_region_reply
{
struct reply_header __header;
user_handle_t top_win;
int top_org_x;
int top_org_y;
int win_org_x;
int win_org_y;
rectangle_t top_rect;
rectangle_t win_rect;
data_size_t total_size;
/* VARARG(region,rectangles); */
};
@ -4417,6 +4415,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
};
#define SERVER_PROTOCOL_VERSION 260
#define SERVER_PROTOCOL_VERSION 261
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View file

@ -2012,10 +2012,8 @@ enum message_type
unsigned int flags; /* DCX flags */
@REPLY
user_handle_t top_win; /* top window to clip against */
int top_org_x; /* top window visible rect origin in screen coords */
int top_org_y;
int win_org_x; /* window rect origin in screen coords */
int win_org_y;
rectangle_t top_rect; /* top window visible rect with screen coords */
rectangle_t win_rect; /* window rect in screen coords */
data_size_t total_size; /* total size of the resulting region */
VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
@END

View file

@ -2521,10 +2521,12 @@ static void dump_get_visible_region_request( const struct get_visible_region_req
static void dump_get_visible_region_reply( const struct get_visible_region_reply *req )
{
fprintf( stderr, " top_win=%p,", req->top_win );
fprintf( stderr, " top_org_x=%d,", req->top_org_x );
fprintf( stderr, " top_org_y=%d,", req->top_org_y );
fprintf( stderr, " win_org_x=%d,", req->win_org_x );
fprintf( stderr, " win_org_y=%d,", req->win_org_y );
fprintf( stderr, " top_rect=" );
dump_rectangle( &req->top_rect );
fprintf( stderr, "," );
fprintf( stderr, " win_rect=" );
dump_rectangle( &req->win_rect );
fprintf( stderr, "," );
fprintf( stderr, " total_size=%u,", req->total_size );
fprintf( stderr, " region=" );
dump_varargs_rectangles( cur_size );

View file

@ -756,6 +756,18 @@ static inline void client_to_screen( struct window *win, int *x, int *y )
}
}
/* convert coordinates from client to screen coords */
static inline void client_to_screen_rect( struct window *win, rectangle_t *rect )
{
for ( ; win && !is_desktop_window(win); win = win->parent)
{
rect->left += win->client_rect.left;
rect->right += win->client_rect.left;
rect->top += win->client_rect.top;
rect->bottom += win->client_rect.top;
}
}
/* map the region from window to screen coordinates */
static inline void map_win_region_to_screen( struct window *win, struct region *region )
{
@ -1826,18 +1838,22 @@ DECL_HANDLER(get_visible_region)
data = get_region_data_and_free( region, get_reply_max_size(), &reply->total_size );
if (data) set_reply_data_ptr( data, reply->total_size );
}
reply->top_win = top->handle;
reply->top_org_x = top->visible_rect.left;
reply->top_org_y = top->visible_rect.top;
reply->top_win = top->handle;
reply->top_rect = top->visible_rect;
if (!is_desktop_window(top))
if (!is_desktop_window(win))
{
reply->win_org_x = (req->flags & DCX_WINDOW) ? win->window_rect.left : win->client_rect.left;
reply->win_org_y = (req->flags & DCX_WINDOW) ? win->window_rect.top : win->client_rect.top;
client_to_screen( top->parent, &reply->top_org_x, &reply->top_org_y );
client_to_screen( win->parent, &reply->win_org_x, &reply->win_org_y );
reply->win_rect = (req->flags & DCX_WINDOW) ? win->window_rect : win->client_rect;
client_to_screen_rect( top->parent, &reply->top_rect );
client_to_screen_rect( win->parent, &reply->win_rect );
}
else
{
reply->win_rect.left = 0;
reply->win_rect.top = 0;
reply->win_rect.right = win->client_rect.right - win->client_rect.left;
reply->win_rect.bottom = win->client_rect.bottom - win->client_rect.top;
}
else reply->win_org_x = reply->win_org_y = 0;
}