Add Xrender support to X11_FillRectangles.
--- a/src/video/x11/SDL_x11render.c Fri May 28 20:48:58 2010 +0530
+++ b/src/video/x11/SDL_x11render.c Sun May 30 20:06:30 2010 +0530
@@ -98,7 +98,7 @@
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
Picture xwindow_pict;
Picture pixmap_picts[3];
- Picture * drawable_pict;
+ Picture drawable_pict;
XRenderPictFormat* xwindow_pict_fmt;
XRenderPictureAttributes xwindow_pict_attr;
unsigned int xwindow_pict_attr_valuemask;
@@ -297,14 +297,14 @@
data->drawable = data->pixmaps[0];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
- data->drawable_pict = &(data->pixmap_picts[0]);
+ data->drawable_pict = data->pixmap_picts[0];
#endif
data->makedirty = SDL_TRUE;
} else {
data->drawable = data->xwindow;
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
- data->drawable_pict = &(data->xwindow_pict);
+ data->drawable_pict = data->xwindow_pict;
#endif
data->makedirty = SDL_FALSE;
}
@@ -380,7 +380,7 @@
if (n > 0) {
data->drawable = data->pixmaps[0];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
- data->drawable_pict = &(data->pictures[0]);
+ data->drawable_pict = data->pictures[0];
#endif
}
data->current_pixmap = 0;
@@ -994,8 +994,18 @@
}
}
if (xcount > 0) {
+#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
+ if(data->xrender_available == SDL_TRUE)
+ {
+ XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
+ (XRenderColor)foreground, xrects, xcount);
+ }
+ else
+#endif
+ {
XFillRectangles(data->display, data->drawable, data->gc,
xrects, xcount);
+ }
}
SDL_stack_free(xpoints);