Module: wine Branch: master Commit: bc6f2f86151458a041ce3baf076de12530ed65d8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bc6f2f86151458a041ce3baf07...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Apr 25 13:18:28 2012 +0200
winex11: Store the DC bounds rectangle as a pointer.
---
dlls/winex11.drv/graphics.c | 1 + dlls/winex11.drv/init.c | 28 +++++++--------------------- dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index b9149bc..0d1e49b 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -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) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 70f792b..ea0befa 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -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 */ diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 28040f6..2548155 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -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;