Knowing if an XserverRegion is empty
iain
iain at openedhand.com
Fri Nov 30 08:41:02 PST 2007
On Fri, 2007-11-30 at 08:28 -0800, Keith Packard wrote:
> On Fri, 2007-11-30 at 12:00 +0000, iain wrote:
>
> > I've managed to do this by calling XFixesFetchRegion and then checking
> > how many rectangles are returned, but is there any great speed penalty
> > for calling this function a lot?
>
> Yes, that requires a round-trip to the X server, which is quite slow.
> Note that subtracting a region from an empty region is a fast operation,
> so unless you have a lot of subtractions you will avoid, it might well
> be faster to do that instead of the round trip.
Well, each subtraction is followed by setting clips on Pictures and
calling XRenderComposite a couple of times, but I suppose if calling
XRenderComposite with an empty XserverRegion as clip isn't slow it
probably won't matter.
Thanks,
iain
More information about the xorg
mailing list