Commit bc6f2f86 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Store the DC bounds rectangle as a pointer.

parent 3ea711dd
......@@ -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,37 +191,24 @@ 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
*/
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;
......
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