mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-19 21:38:32 +00:00
winex11: Store the DC bounds rectangle as a pointer.
This commit is contained in:
parent
3ea711dd7c
commit
bc6f2f8615
|
@ -109,6 +109,7 @@ static void add_pen_device_bounds( X11DRV_PDEVICE *dev, const POINT *points, int
|
|||
RECT bounds, rect;
|
||||
int width = 0;
|
||||
|
||||
if (!dev->bounds) return;
|
||||
reset_bounds( &bounds );
|
||||
|
||||
if (dev->pen.type & PS_GEOMETRIC || dev->pen.width > 1)
|
||||
|
|
|
@ -118,7 +118,6 @@ static X11DRV_PDEVICE *create_x11_physdev( Drawable drawable )
|
|||
|
||||
if (!(physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) ))) return NULL;
|
||||
|
||||
reset_bounds( &physDev->bounds );
|
||||
wine_tsx11_lock();
|
||||
physDev->drawable = drawable;
|
||||
physDev->gc = XCreateGC( gdi_display, drawable, 0, NULL );
|
||||
|
@ -192,27 +191,14 @@ void add_device_bounds( X11DRV_PDEVICE *dev, const RECT *rect )
|
|||
{
|
||||
RECT rc;
|
||||
|
||||
if (!dev->bounds) return;
|
||||
if (dev->region && GetRgnBox( dev->region, &rc ))
|
||||
{
|
||||
if (IntersectRect( &rc, &rc, rect )) add_bounds_rect( &dev->bounds, &rc );
|
||||
if (IntersectRect( &rc, &rc, rect )) add_bounds_rect( dev->bounds, &rc );
|
||||
}
|
||||
else add_bounds_rect( &dev->bounds, rect );
|
||||
else add_bounds_rect( dev->bounds, rect );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* dibdrv_GetBoundsRect
|
||||
*/
|
||||
static UINT X11DRV_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
|
||||
{
|
||||
X11DRV_PDEVICE *pdev = get_x11drv_dev( dev );
|
||||
|
||||
if (IsRectEmpty( &pdev->bounds )) return DCB_RESET;
|
||||
if (rect) *rect = pdev->bounds;
|
||||
if (flags & DCB_RESET) reset_bounds( &pdev->bounds );
|
||||
return DCB_SET;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_SetBoundsRect
|
||||
*/
|
||||
|
@ -220,9 +206,9 @@ static UINT X11DRV_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
|
|||
{
|
||||
X11DRV_PDEVICE *pdev = get_x11drv_dev( dev );
|
||||
|
||||
if (IsRectEmpty( &pdev->bounds )) return DCB_RESET;
|
||||
if (flags & DCB_RESET) reset_bounds( &pdev->bounds );
|
||||
return DCB_SET;
|
||||
if (flags & DCB_DISABLE) pdev->bounds = NULL;
|
||||
else if (flags & DCB_ENABLE) pdev->bounds = rect;
|
||||
return DCB_RESET; /* we don't have device-specific bounds */
|
||||
}
|
||||
|
||||
|
||||
|
@ -516,7 +502,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
|
|||
NULL, /* pFrameRgn */
|
||||
NULL, /* pGdiComment */
|
||||
NULL, /* pGdiRealizationInfo */
|
||||
X11DRV_GetBoundsRect, /* pGetBoundsRect */
|
||||
NULL, /* pGetBoundsRect */
|
||||
NULL, /* pGetCharABCWidths */
|
||||
NULL, /* pGetCharABCWidthsI */
|
||||
NULL, /* pGetCharWidth */
|
||||
|
|
|
@ -123,7 +123,7 @@ typedef struct
|
|||
Drawable drawable;
|
||||
RECT dc_rect; /* DC rectangle relative to drawable */
|
||||
RECT drawable_rect; /* Drawable rectangle relative to screen */
|
||||
RECT bounds; /* Graphics bounds */
|
||||
RECT *bounds; /* Graphics bounds */
|
||||
HRGN region; /* Device region (visible region & clip region) */
|
||||
X_PHYSPEN pen;
|
||||
X_PHYSBRUSH brush;
|
||||
|
|
Loading…
Reference in a new issue