Gradients for Xrender

Keith Packard keithp at keithp.com
Mon May 30 13:13:42 PDT 2005


On Mon, 2005-05-30 at 19:22 +0200, Lars Knoll wrote:
> Hi,
> 
> I had some time over the weekend and added support for gradients to render.

That's cool, and I think the idea of using a picture is really a good
one.


> The implementation supports all the gradient types defined in SVG (linear, 
> radial and conical). What I've done is to extend Render by one more request:

I think I'd rather see this use a new request for each gradient type;
overriding operands doesn't seem necessary, and that way I think the
client API will be less error-prone.

> The reason for doing it this way is that one gets full support for Gradients 
> as source/mask pictures in all XRender calls. To the client a gradient is 
> just another Picture (though he would get errors if he tried to paint onto 
> it), that can be used in all compositing operations and that can be freed 
> using XRenderFreePicture. At the same time the gradient is independent of the 
> Screen as it doesn't need to hold any data associated with a particular 
> screen.

That's great.  I'd like to figure out how to do something similar with
image transport so we don't have to have many new compositing requests
to deal with images.  Perhaps some similar scheme could work...

> The algorithm seems to be reasonably fast. For a full screen (1280x1024) a 
> linear gradient takes about 50ms, a radial gradient 130ms and a conical about 
> 200ms (tested using Xephyr) on my hardware.

You're making my compositing code look pretty bad; I may have to do
something about that :-)

Let's figure out what the right interface is and we can bump the Render
minor protocol number and get the code into CVS.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20050530/abe1d415/attachment.pgp>


More information about the xorg mailing list