Re: suggestions wanted for tricky shaped window problem




Paul Barton-Davis <pbd@Op.Net> writes:

> I've grown quite comfortable with shape windows created from xpm files.
> 
> I'm now working on a more difficult problem. I have a pixmap. I draw
> into it (lets assume with gdk_draw_lines()). Before each drawing, I
> clear the pixmap, and after it, I want to reset its shape to include
> only those pixels that were set by the drawing operation.
> 
> This means, I think, computing a bitmap from the pixmap to pass into
> gdk_window_shape_combine(). I tried the naive approach of using
> XCopyPlane for every plane in the source pixmap, and then resetting
> the shape. This is *dog* slow.

Yep, XCopyPlane tends to be pessimized on standard PC hardware
(which is not planar)

It would probably be slightly more efficient to draw in a bitmap
in parallel with drawing in the pixmap. I.e., draw each line
in both places.
 
> I'm looking for ideas. The overall goal is an essentially transparent
> window where things can be drawn and redrawn, and whatever is
> underneath is visible except where something has been drawn in the
> "essentially transparent" window.
> 
> Let me know if you have any ideas. I think this is a hard thing to do
> with X, but I could be wrong.

Basically, it is an impossible thing to do in X and have
it perform at all decently if you have complicated shapes;
X's method of dealing with shaped windows is to store
them as lists of rectangles.

Maybe someday, somebody will write a real alpha-channel
extension for X...
                                        Owen



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