comparison src/video/x11/SDL_x11render.c @ 4576:2b98162b536a

Add Xrender support to X11_FillRectangles.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Sun, 30 May 2010 20:06:30 +0530
parents 037ddbeee6c3
children 87a2d87786d4
comparison
equal deleted inserted replaced
4575:037ddbeee6c3 4576:2b98162b536a
96 Window xwindow; 96 Window xwindow;
97 Pixmap pixmaps[3]; 97 Pixmap pixmaps[3];
98 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 98 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
99 Picture xwindow_pict; 99 Picture xwindow_pict;
100 Picture pixmap_picts[3]; 100 Picture pixmap_picts[3];
101 Picture * drawable_pict; 101 Picture drawable_pict;
102 XRenderPictFormat* xwindow_pict_fmt; 102 XRenderPictFormat* xwindow_pict_fmt;
103 XRenderPictureAttributes xwindow_pict_attr; 103 XRenderPictureAttributes xwindow_pict_attr;
104 unsigned int xwindow_pict_attr_valuemask; 104 unsigned int xwindow_pict_attr_valuemask;
105 SDL_bool xrender_available; 105 SDL_bool xrender_available;
106 #endif 106 #endif
295 } 295 }
296 if (n > 0) { 296 if (n > 0) {
297 data->drawable = data->pixmaps[0]; 297 data->drawable = data->pixmaps[0];
298 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 298 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
299 if(data->xrender_available == SDL_TRUE) 299 if(data->xrender_available == SDL_TRUE)
300 data->drawable_pict = &(data->pixmap_picts[0]); 300 data->drawable_pict = data->pixmap_picts[0];
301 #endif 301 #endif
302 data->makedirty = SDL_TRUE; 302 data->makedirty = SDL_TRUE;
303 } else { 303 } else {
304 data->drawable = data->xwindow; 304 data->drawable = data->xwindow;
305 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 305 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
306 if(data->xrender_available == SDL_TRUE) 306 if(data->xrender_available == SDL_TRUE)
307 data->drawable_pict = &(data->xwindow_pict); 307 data->drawable_pict = data->xwindow_pict;
308 #endif 308 #endif
309 data->makedirty = SDL_FALSE; 309 data->makedirty = SDL_FALSE;
310 } 310 }
311 data->current_pixmap = 0; 311 data->current_pixmap = 0;
312 312
378 #endif 378 #endif
379 } 379 }
380 if (n > 0) { 380 if (n > 0) {
381 data->drawable = data->pixmaps[0]; 381 data->drawable = data->pixmaps[0];
382 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 382 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
383 data->drawable_pict = &(data->pictures[0]); 383 data->drawable_pict = data->pictures[0];
384 #endif 384 #endif
385 } 385 }
386 data->current_pixmap = 0; 386 data->current_pixmap = 0;
387 387
388 return 0; 388 return 0;
992 if (data->makedirty) { 992 if (data->makedirty) {
993 SDL_AddDirtyRect(&data->dirty, &rect); 993 SDL_AddDirtyRect(&data->dirty, &rect);
994 } 994 }
995 } 995 }
996 if (xcount > 0) { 996 if (xcount > 0) {
997 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
998 if(data->xrender_available == SDL_TRUE)
999 {
1000 XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
1001 (XRenderColor)foreground, xrects, xcount);
1002 }
1003 else
1004 #endif
1005 {
997 XFillRectangles(data->display, data->drawable, data->gc, 1006 XFillRectangles(data->display, data->drawable, data->gc,
998 xrects, xcount); 1007 xrects, xcount);
1008 }
999 } 1009 }
1000 SDL_stack_free(xpoints); 1010 SDL_stack_free(xpoints);
1001 1011
1002 return 0; 1012 return 0;
1003 } 1013 }