On Tue, 11 Dec 2001, Jonathan Walther wrote:

> The question, then the context:
> 
> I have a bitmap, A.  I set this bitmask as the clip mask
> in my GC.  If I modify A, do I have to re-call XSetClipMask()
> for the modifications to take effect?

    Yes.

> 
> I have a square area, lets say 400x400.  I frequently re-paint the
> whole area with different sections of a larger drawable.  However
> I have another little image that I draw on top, 30x30 in size.
> When I draw this little box, I have no problem doing the masking such
> that the little arrow symbol is drawn on top of the larger area without
> disturbing the image underneath.  But the location of the little box
> also frequently changes, so making a static clipmask the size of the
> 400x400 area isn't the way.  I'd like to be able to repaint the whole
> 400x400 area, without disturbing the little arrow symbol.  I would like
> to do this with one XCopyArea() operation, because when I use more than
> one XCopyArea to copy the area, the artifacts are very visible.
> 
> What is the method that involves the least amount of X calls, or at
> least is the fastest possible, method to repaint my window?

   Changing the GC clip mask is a very slow operation and using
GC clip masks should be avoided in performance paths.

  Render everything into a pixmap, set it as the window background
and call XClearArea on the window areas you need updated.
Note that if you've changed the pixmap contents you need to
reset it as the window background because the protocol doesn't
guarantee that the new contents will go into effect without that.
Note that the pixmap doesn't get damaged when the window does
and the window will automatically get repainted from the background
pixmap on exposures so you don't need to handle expose events anymore.

  If the arrow is monochrome, the fastest way to render it is with
a stippled fill using a monochrome bitmap with the shape of the
arrow in it.

Copy large drawable to 400x400 pixmap (single rectangle)
render arrow (single stippled rectangle, note that you'll have
   to use XSetTSOrigin to have it match the arrow location since
   GC stipples are drawable aligned).
set pixmap as window background
XClearArea

   Do nothing at all for exposures.


                        Mark.

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to