From d302db41aa4ca227bae6dc623668f040e1b02275 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 12 Dec 2006 13:46:15 +0100 Subject: [PATCH] winex11.drv: Make sure the drawable rect is always updated and use it where appropriate. --- dlls/winex11.drv/bitblt.c | 10 +++------- dlls/winex11.drv/bitmap.c | 5 +++++ dlls/winex11.drv/init.c | 5 +++++ dlls/winex11.drv/xrender.c | 10 +++------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index b143bf41fa2..00bf37502c1 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -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; diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index 726581a652d..75623e4a6b3 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -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 */ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 9b2b9c81131..c33301aa418 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -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 ); diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 317a36b8241..9c5e274281d 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -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++) { -- 2.11.4.GIT