Re: pseudo transparency



Sasha Vasko <sasha aftercode net> writes:

> Owen Taylor wrote:
> 
> > Sasha Vasko <sasha aftercode net> writes:
> >>>You cannot shade but you can tint. By using GC with function set to XOR,
> >>>you can tint background in 6 "whole" colors: red, green, blue, yellow,
> >>>cyan, mag. by simple XFillRectangle. Works rather nicely in aterm.
> >>>
> >> Actually just after I sent this it occured to me that using XRender
> >> it is indeed very easy to shade Window that has ParentRelative
> >> background. All one has to do is to use image pixmap 1x1 of desired
> >> color (white , grey, black)  and alpha pixmap filled with some
> >> meaningfull alpha value ( 0x7F for example )  and on each Expose or
> >> ConfigureNotify - do XClearArea and XRenderComposite.
> >>
> >>In fact I tried it and it works rather nicely.
> >>
> >>That makes ParentRelative a very interesting alternative.
> >>
> > I don't think RENDER (or plane masks) are actually useful with the
> > parent-relative thing since you have to _first_ clear, _then_ tint,
> > which is not going to look OK for ConfigureNotify or when scrolling.
> 
> 
> It looks wonderfull. I've been using it for 2 years and so did many
> others, and there was only positive feedback.

As far as I can see:

If you call XClearWindow(), then XFillRectangle() with a plane mask,
then there _will_ be a period of time when the window is drawn
untinted, and the user will see a flash if it occurs at the wrong
time. This is completely unavoidable with the standard X protocol.
 
> In fact ConfigureNotify handling in particular works much better then
> Eterm approach. Plus it is using much less memory.

You can do the same XFillRectangle() trick using _XROOTPMAP_ID
.. there may be a tiny bit more lag than with the
parent-relative-background hack, since you need a round trip call to
XTranslateCoordinates, but it isn't going to use more CPU or more
memory.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]