Avoid unnecessary GraphicsExpose events.

This commit is contained in:
Ulrich Weigand 1999-03-10 13:26:09 +00:00 committed by Alexandre Julliard
parent 66e3a85586
commit 9cfeb5b88c
3 changed files with 14 additions and 6 deletions

View File

@ -1242,27 +1242,29 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
case SRCCOPY: /* 0xcc */ case SRCCOPY: /* 0xcc */
if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel) if (dcSrc->w.bitsPerPixel == dcDst->w.bitsPerPixel)
{ {
XSetGraphicsExposures( display, physDevDst->gc, True ); BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, True );
XSetFunction( display, physDevDst->gc, GXcopy ); XSetFunction( display, physDevDst->gc, GXcopy );
XCopyArea( display, physDevSrc->drawable, XCopyArea( display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc, physDevDst->drawable, physDevDst->gc,
visRectSrc.left, visRectSrc.top, visRectSrc.left, visRectSrc.top,
width, height, visRectDst.left, visRectDst.top ); width, height, visRectDst.left, visRectDst.top );
XSetGraphicsExposures( display, physDevDst->gc, False ); if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, False );
return TRUE; return TRUE;
} }
if (dcSrc->w.bitsPerPixel == 1) if (dcSrc->w.bitsPerPixel == 1)
{ {
BOOL expose = !(dcSrc->w.flags & DC_MEMORY) && !(dcDst->w.flags & DC_MEMORY);
XSetBackground( display, physDevDst->gc, physDevDst->textPixel ); XSetBackground( display, physDevDst->gc, physDevDst->textPixel );
XSetForeground( display, physDevDst->gc, XSetForeground( display, physDevDst->gc,
physDevDst->backgroundPixel ); physDevDst->backgroundPixel );
XSetFunction( display, physDevDst->gc, GXcopy ); XSetFunction( display, physDevDst->gc, GXcopy );
XSetGraphicsExposures( display, physDevDst->gc, True ); if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, True );
XCopyPlane( display, physDevSrc->drawable, XCopyPlane( display, physDevSrc->drawable,
physDevDst->drawable, physDevDst->gc, physDevDst->drawable, physDevDst->gc,
visRectSrc.left, visRectSrc.top, visRectSrc.left, visRectSrc.top,
width, height, visRectDst.left, visRectDst.top, 1 ); width, height, visRectDst.left, visRectDst.top, 1 );
XSetGraphicsExposures( display, physDevDst->gc, False ); if ( expose ) XSetGraphicsExposures( display, physDevDst->gc, False );
return TRUE; return TRUE;
} }
break; break;
@ -1290,6 +1292,7 @@ static BOOL BITBLT_InternalStretchBlt( DC *dcDst, INT xDst, INT yDst,
} }
tmpGC = XCreateGC( display, physDevDst->drawable, 0, NULL ); tmpGC = XCreateGC( display, physDevDst->drawable, 0, NULL );
XSetGraphicsExposures( display, tmpGC, False );
pixmaps[DST] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height, pixmaps[DST] = XCreatePixmap( display, X11DRV_GetXRootWindow(), width, height,
dcDst->w.bitsPerPixel ); dcDst->w.bitsPerPixel );
if (useSrc) if (useSrc)

View File

@ -112,6 +112,7 @@ HBITMAP X11DRV_BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
{ {
TSXFreeGC( display, physDev->gc ); TSXFreeGC( display, physDev->gc );
physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL ); physDev->gc = TSXCreateGC( display, physDev->drawable, 0, NULL );
TSXSetGraphicsExposures( display, physDev->gc, False );
dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel; dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
DC_InitDC( dc ); DC_InitDC( dc );
} }

View File

@ -402,8 +402,12 @@ static void EVENT_ProcessEvent( XEvent *event )
} }
} }
TRACE(event, "Got event %s for hwnd %04x\n", if ( !pWnd && event->xany.window != X11DRV_GetXRootWindow() )
event_names[event->type], pWnd? pWnd->hwndSelf : 0 ); ERR( event, "Got event %s for unknown Window %08lx\n",
event_names[event->type], event->xany.window );
else
TRACE( event, "Got event %s for hwnd %04x\n",
event_names[event->type], pWnd? pWnd->hwndSelf : 0 );
switch(event->type) switch(event->type)
{ {