Commit 99aee647 authored by Sunny Sachanandani's avatar Sunny Sachanandani

X11_RenderPresent now uses XRender to blit back-buffers to the screen.

parent 6f98c350
...@@ -1205,9 +1205,19 @@ X11_RenderPresent(SDL_Renderer * renderer) ...@@ -1205,9 +1205,19 @@ X11_RenderPresent(SDL_Renderer * renderer)
if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) { if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) {
for (dirty = data->dirty.list; dirty; dirty = dirty->next) { for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
const SDL_Rect *rect = &dirty->rect; const SDL_Rect *rect = &dirty->rect;
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
{
XRenderComposite(data->display, PictOpSrc, data->drawable_pict, None, data->xwindow_pict,
rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h);
}
else
#endif
{
XCopyArea(data->display, data->drawable, data->xwindow, XCopyArea(data->display, data->drawable, data->xwindow,
data->gc, rect->x, rect->y, rect->w, rect->h, data->gc, rect->x, rect->y, rect->w, rect->h,
rect->x, rect->y); rect->x, rect->y);
}
} }
SDL_ClearDirtyRects(&data->dirty); SDL_ClearDirtyRects(&data->dirty);
} }
...@@ -1217,9 +1227,15 @@ X11_RenderPresent(SDL_Renderer * renderer) ...@@ -1217,9 +1227,15 @@ X11_RenderPresent(SDL_Renderer * renderer)
if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
data->current_pixmap = (data->current_pixmap + 1) % 2; data->current_pixmap = (data->current_pixmap + 1) % 2;
data->drawable = data->pixmaps[data->current_pixmap]; data->drawable = data->pixmaps[data->current_pixmap];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
data->drawable_pict = data->pixmap_picts[data->current_pixmap];
#endif
} else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) { } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
data->current_pixmap = (data->current_pixmap + 1) % 3; data->current_pixmap = (data->current_pixmap + 1) % 3;
data->drawable = data->pixmaps[data->current_pixmap]; data->drawable = data->pixmaps[data->current_pixmap];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
data->drawable_pict = data->pixmap_picts[data->current_pixmap];
#endif
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment