Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Add Xrender support to X11_FillRectangles.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyps committed May 30, 2010
1 parent c8d828b commit 54edf7b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/video/x11/SDL_x11render.c
Expand Up @@ -98,7 +98,7 @@ typedef struct
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
Picture xwindow_pict;
Picture pixmap_picts[3];
Picture * drawable_pict;
Picture drawable_pict;
XRenderPictFormat* xwindow_pict_fmt;
XRenderPictureAttributes xwindow_pict_attr;
unsigned int xwindow_pict_attr_valuemask;
Expand Down Expand Up @@ -297,14 +297,14 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags)
data->drawable = data->pixmaps[0];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
data->drawable_pict = &(data->pixmap_picts[0]);
data->drawable_pict = data->pixmap_picts[0];
#endif
data->makedirty = SDL_TRUE;
} else {
data->drawable = data->xwindow;
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
data->drawable_pict = &(data->xwindow_pict);
data->drawable_pict = data->xwindow_pict;
#endif
data->makedirty = SDL_FALSE;
}
Expand Down Expand Up @@ -380,7 +380,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer)
if (n > 0) {
data->drawable = data->pixmaps[0];
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
data->drawable_pict = &(data->pictures[0]);
data->drawable_pict = data->pictures[0];
#endif
}
data->current_pixmap = 0;
Expand Down Expand Up @@ -994,8 +994,18 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count)
}
}
if (xcount > 0) {
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if(data->xrender_available == SDL_TRUE)
{
XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict,
(XRenderColor)foreground, xrects, xcount);
}
else
#endif
{
XFillRectangles(data->display, data->drawable, data->gc,
xrects, xcount);
}
}
SDL_stack_free(xpoints);

Expand Down

0 comments on commit 54edf7b

Please sign in to comment.