if anyone has problems with a XiGraphics XServer messing up when a YUVOverlay is moved or resized, this patch to the cvs might help!
I noticed it sometimes lost the colorkey and no longer showed all the overlay!
This was a pain, to have happen, so I hacked in a fix. It’s not likely to be SDL CVS codebase worthy, but perhaps if someone tweaks it only to help the xig users it might be nice.
I no longer use the xig server now that xorg and the linux kernel support openGL on my hardware…but perhaps some other people may like this.
I figured this was the best place to post it for others to reap as needed…
-LIM-
----------------------patch----------------------------------------
Index: src/video/x11/SDL_x11yuv.c===================================================================
RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/x11/SDL_x11yuv.c,v
retrieving revision 1.16
diff -u -b -B -r1.16 SDL_x11yuv.c
— src/video/x11/SDL_x11yuv.c 25 Aug 2004 05:39:03 -0000 1.16
+++ src/video/x11/SDL_x11yuv.c 14 Dec 2004 00:54:12 -0000
@@ -365,8 +365,28 @@
int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect)
{
struct private_yuvhwdata *hwdata;
-
static SDL_Rect prev={0,0,0,0}; hwdata = overlay->hwdata;
-
if(prev.x!=dstrect->x || prev.y!=dstrect->y || prev.w!=dstrect->w || prev.h!=dstrect->h)
-
{
-
Atom the_atom;
-
int value;
-
the_atom=XInternAtom(GFX_Display, "XV_COLORKEY", True);
-
if(the_atom != None)
-
{
-
if((Success == SDL_NAME(XvGetPortAttribute)(GFX_Display,
-
hwdata->port, the_atom, &value)))
-
{
-
/*printf("XV_COLORKEY=0x%08x\n",value);*/
-
XSetForeground(GFX_Display,SDL_GC,value);
-
XFillRectangle(GFX_Display, SDL_Window, SDL_GC,
-
dstrect->x, dstrect->y,
-
dstrect->w, dstrect->h);
-
}
-
}
-
memcpy(&prev,dstrect,sizeof(SDL_Rect));
-
#ifndef NO_SHARED_MEMORY}
if ( hwdata->yuv_use_mitshm ) {
SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,