Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11render.c @ 4579:d490d63bcc5e
X11_RenderPresent now uses XRender to blit back-buffers to the screen.
author | Sunny Sachanandani <sunnysachanandani@gmail.com> |
---|---|
date | Mon, 31 May 2010 17:04:20 +0530 |
parents | cb338fa6535c |
children | cfea5b007bc7 |
comparison
equal
deleted
inserted
replaced
4578:cb338fa6535c | 4579:d490d63bcc5e |
---|---|
1203 | 1203 |
1204 /* Send the data to the display */ | 1204 /* Send the data to the display */ |
1205 if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) { | 1205 if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) { |
1206 for (dirty = data->dirty.list; dirty; dirty = dirty->next) { | 1206 for (dirty = data->dirty.list; dirty; dirty = dirty->next) { |
1207 const SDL_Rect *rect = &dirty->rect; | 1207 const SDL_Rect *rect = &dirty->rect; |
1208 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER | |
1209 if(data->xrender_available == SDL_TRUE) | |
1210 { | |
1211 XRenderComposite(data->display, PictOpSrc, data->drawable_pict, None, data->xwindow_pict, | |
1212 rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); | |
1213 } | |
1214 else | |
1215 #endif | |
1216 { | |
1208 XCopyArea(data->display, data->drawable, data->xwindow, | 1217 XCopyArea(data->display, data->drawable, data->xwindow, |
1209 data->gc, rect->x, rect->y, rect->w, rect->h, | 1218 data->gc, rect->x, rect->y, rect->w, rect->h, |
1210 rect->x, rect->y); | 1219 rect->x, rect->y); |
1220 } | |
1211 } | 1221 } |
1212 SDL_ClearDirtyRects(&data->dirty); | 1222 SDL_ClearDirtyRects(&data->dirty); |
1213 } | 1223 } |
1214 XSync(data->display, False); | 1224 XSync(data->display, False); |
1215 | 1225 |
1216 /* Update the flipping chain, if any */ | 1226 /* Update the flipping chain, if any */ |
1217 if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { | 1227 if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { |
1218 data->current_pixmap = (data->current_pixmap + 1) % 2; | 1228 data->current_pixmap = (data->current_pixmap + 1) % 2; |
1219 data->drawable = data->pixmaps[data->current_pixmap]; | 1229 data->drawable = data->pixmaps[data->current_pixmap]; |
1230 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER | |
1231 data->drawable_pict = data->pixmap_picts[data->current_pixmap]; | |
1232 #endif | |
1220 } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) { | 1233 } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) { |
1221 data->current_pixmap = (data->current_pixmap + 1) % 3; | 1234 data->current_pixmap = (data->current_pixmap + 1) % 3; |
1222 data->drawable = data->pixmaps[data->current_pixmap]; | 1235 data->drawable = data->pixmaps[data->current_pixmap]; |
1236 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER | |
1237 data->drawable_pict = data->pixmap_picts[data->current_pixmap]; | |
1238 #endif | |
1223 } | 1239 } |
1224 } | 1240 } |
1225 | 1241 |
1226 static void | 1242 static void |
1227 X11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) | 1243 X11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) |