[PATCH] xfixes: Forbid manipulating clip for source-only pictures (#28968)
Adam Jackson
ajax at redhat.com
Tue Apr 22 06:53:59 PDT 2014
On Mon, 2014-04-21 at 21:51 -0700, Keith Packard wrote:
> Adam Jackson <ajax at redhat.com> writes:
>
> > Just throw BadPicture instead of crashing. It's not currently a
> > meaningful thing to do anyway, RenderSetPictureRectangles would error if
> > you tried (which this patch changes to BadPicture as well for
> > consistency). The problem with trying to do it is if the clip is
> > specified as a pixmap then we try to convert it to a region, and
> > ->BitmapToRegion requires a ScreenPtr, and source-only pictures don't
> > have one.
>
> And source-only pictures can't get a CT_PIXMAP set -- CPClipMask returns
> BadDrawable when you try to do that on a picture without a drawable.
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <X11/extensions/Xfixes.h>
int main(void)
{
XRenderColor c = { 0, 0, 0, 0 };
Display *dpy = XOpenDisplay(NULL);
Picture p = XRenderCreateSolidFill(dpy, &c);
XFixesSetPictureClipRegion(dpy, p, 0, 0, None);
XSync(dpy, 0);
return 0;
}
- ajax
More information about the xorg-devel
mailing list