# HG changeset patch # User Sunny Sachanandani # Date 1274715178 -19800 # Node ID 97dcf6f6213c7bec39cd57f063a7d46ad16b5fdc # Parent 36fad921c97f5da4fb641a3c7eb22c9f049ce4f5 Added a #define option for compile time Xrender support. Added some more attributes (specific to Xrender) to the X11 structs. Added some code for querying the Xrender extension. diff -r 36fad921c97f -r 97dcf6f6213c src/video/x11/SDL_x11render.c --- a/src/video/x11/SDL_x11render.c Wed May 19 18:58:28 2010 +0530 +++ b/src/video/x11/SDL_x11render.c Mon May 24 21:02:58 2010 +0530 @@ -95,6 +95,13 @@ int scanline_pad; Window xwindow; Pixmap pixmaps[3]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + Picture xwindow_pict; + XRenderPictFormat* xwindow_pict_fmt; + XRenderPictureAttributes xwindow_pict_attr; + unsigned int xwindow_pict_attr_valuemask; + SDL_bool xrender_available; +#endif int current_pixmap; Drawable drawable; SDL_PixelFormat format; @@ -108,6 +115,9 @@ SDL_SW_YUVTexture *yuv; Uint32 format; Pixmap pixmap; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + Picture picture; +#endif XImage *image; #ifndef NO_SHARED_MEMORY /* MIT shared memory extension information */ @@ -198,7 +208,22 @@ data->depth = displaydata->depth; data->scanline_pad = displaydata->scanline_pad; data->xwindow = windowdata->xwindow; - +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + int event_basep, error_basep; + if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { + data->xrender_available = SDL_TRUE; + data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + data->xwindow_pict_attr_valuemask = 0; // FIXME + data->xwindow_pict = XRenderCreatePicture(data->display, + data->xwindow, + data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, + &data->xwindow_pict_attr); + } + else { + data->xrender_available = SDL_FALSE; + } +#endif renderer->DisplayModeChanged = X11_DisplayModeChanged; renderer->CreateTexture = X11_CreateTexture; renderer->QueryTexturePixels = X11_QueryTexturePixels;