winex11.drv: Make sure the drawable rect is always updated and use it where appropriate.

This commit is contained in:
Alexandre Julliard 2006-12-12 13:46:15 +01:00
parent 4bdf4345b8
commit d302db41aa
4 changed files with 16 additions and 14 deletions

View File

@ -1149,13 +1149,9 @@ static BOOL BITBLT_GetVisRectangles( X11DRV_PDEVICE *physDevDst, INT xDst, INT y
if (heightSrc < 0) SWAP_INT32( &rect.top, &rect.bottom );
/* Apparently the clipping and visible regions are only for output,
so just check against dc extent here to avoid BadMatch errors */
if (physDevSrc->bitmap)
{
BITMAP bm;
GetObjectW( physDevSrc->bitmap->hbitmap, sizeof(bm), &bm );
SetRect( &clipRect, 0, 0, bm.bmWidth, bm.bmHeight );
}
else clipRect = virtual_screen_rect;
clipRect = physDevSrc->drawable_rect;
OffsetRect( &clipRect, -(physDevSrc->drawable_rect.left + physDevSrc->dc_rect.left),
-(physDevSrc->drawable_rect.top + physDevSrc->dc_rect.top) );
if (!IntersectRect( visRectSrc, &rect, &clipRect ))
return FALSE;

View File

@ -72,6 +72,9 @@ void X11DRV_BITMAP_Init(void)
HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
{
X_PHYSBITMAP *physBitmap;
BITMAP bitmap;
if (!GetObjectW( hbitmap, sizeof(bitmap), &bitmap )) return 0;
if(physDev->xrender)
X11DRV_XRender_UpdateDrawable( physDev );
@ -81,6 +84,8 @@ HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
physDev->bitmap = physBitmap;
physDev->drawable = physBitmap->pixmap;
SetRect( &physDev->drawable_rect, 0, 0, bitmap.bmWidth, bitmap.bmHeight );
physDev->dc_rect = physDev->drawable_rect;
/* Change GC depth if needed */

View File

@ -135,12 +135,17 @@ BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR de
physDev->bitmap = &BITMAP_stock_phys_bitmap;
physDev->drawable = BITMAP_stock_phys_bitmap.pixmap;
physDev->depth = 1;
SetRect( &physDev->drawable_rect, 0, 0, 1, 1 );
physDev->dc_rect = physDev->drawable_rect;
}
else
{
physDev->bitmap = NULL;
physDev->drawable = root_window;
physDev->depth = screen_depth;
physDev->drawable_rect = virtual_screen_rect;
SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top );
}
physDev->region = CreateRectRgn( 0, 0, 0, 0 );

View File

@ -1327,16 +1327,12 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
} else {
XImage *image;
unsigned int w, h, dummy_uint;
Window dummy_window;
int dummy_int;
int image_x, image_y, image_off_x, image_off_y, image_w, image_h;
RECT extents = {0, 0, 0, 0};
POINT cur = {0, 0};
XGetGeometry(gdi_display, physDev->drawable, &dummy_window, &dummy_int, &dummy_int,
&w, &h, &dummy_uint, &dummy_uint);
int w = physDev->drawable_rect.right - physDev->drawable_rect.left;
int h = physDev->drawable_rect.bottom - physDev->drawable_rect.top;
TRACE("drawable %dx%d\n", w, h);
for(idx = 0; idx < count; idx++) {