comparison src/video/x11/SDL_x11render.c @ 4571:97dcf6f6213c

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.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Mon, 24 May 2010 21:02:58 +0530
parents c9584df65367
children 266ec93f49af
comparison
equal deleted inserted replaced
4570:36fad921c97f 4571:97dcf6f6213c
93 Visual *visual; 93 Visual *visual;
94 int depth; 94 int depth;
95 int scanline_pad; 95 int scanline_pad;
96 Window xwindow; 96 Window xwindow;
97 Pixmap pixmaps[3]; 97 Pixmap pixmaps[3];
98 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
99 Picture xwindow_pict;
100 XRenderPictFormat* xwindow_pict_fmt;
101 XRenderPictureAttributes xwindow_pict_attr;
102 unsigned int xwindow_pict_attr_valuemask;
103 SDL_bool xrender_available;
104 #endif
98 int current_pixmap; 105 int current_pixmap;
99 Drawable drawable; 106 Drawable drawable;
100 SDL_PixelFormat format; 107 SDL_PixelFormat format;
101 GC gc; 108 GC gc;
102 SDL_DirtyRectList dirty; 109 SDL_DirtyRectList dirty;
106 typedef struct 113 typedef struct
107 { 114 {
108 SDL_SW_YUVTexture *yuv; 115 SDL_SW_YUVTexture *yuv;
109 Uint32 format; 116 Uint32 format;
110 Pixmap pixmap; 117 Pixmap pixmap;
118 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
119 Picture picture;
120 #endif
111 XImage *image; 121 XImage *image;
112 #ifndef NO_SHARED_MEMORY 122 #ifndef NO_SHARED_MEMORY
113 /* MIT shared memory extension information */ 123 /* MIT shared memory extension information */
114 XShmSegmentInfo shminfo; 124 XShmSegmentInfo shminfo;
115 #endif 125 #endif
196 data->screen = displaydata->screen; 206 data->screen = displaydata->screen;
197 data->visual = displaydata->visual; 207 data->visual = displaydata->visual;
198 data->depth = displaydata->depth; 208 data->depth = displaydata->depth;
199 data->scanline_pad = displaydata->scanline_pad; 209 data->scanline_pad = displaydata->scanline_pad;
200 data->xwindow = windowdata->xwindow; 210 data->xwindow = windowdata->xwindow;
201 211 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
212 int event_basep, error_basep;
213 if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) {
214 data->xrender_available = SDL_TRUE;
215 data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual);
216 data->xwindow_pict_attr_valuemask = 0; // FIXME
217 data->xwindow_pict = XRenderCreatePicture(data->display,
218 data->xwindow,
219 data->xwindow_pict_fmt,
220 data->xwindow_pict_attr_valuemask,
221 &data->xwindow_pict_attr);
222 }
223 else {
224 data->xrender_available = SDL_FALSE;
225 }
226 #endif
202 renderer->DisplayModeChanged = X11_DisplayModeChanged; 227 renderer->DisplayModeChanged = X11_DisplayModeChanged;
203 renderer->CreateTexture = X11_CreateTexture; 228 renderer->CreateTexture = X11_CreateTexture;
204 renderer->QueryTexturePixels = X11_QueryTexturePixels; 229 renderer->QueryTexturePixels = X11_QueryTexturePixels;
205 renderer->SetTextureBlendMode = X11_SetTextureBlendMode; 230 renderer->SetTextureBlendMode = X11_SetTextureBlendMode;
206 renderer->SetTextureScaleMode = X11_SetTextureScaleMode; 231 renderer->SetTextureScaleMode = X11_SetTextureScaleMode;