[comp.windows.x] CLX draw-rectangle with TILING question

sol@lucid.com (Sonia Lyris) (02/02/89)

It is my understanding from reading the CLX documentation for X11R2 (and from
experimentation) that it is not possible to specify a gcontext tile pixmap of
depth 1 for a draw-rectangle operation to a destination of depth N, N > 1:
  "The tile pixmap must have the same root and depth as the graphic context."

This, of course, requires me to have a tile pixmap of depth 1 AND the same tile
pixmap of depth N if I expect to run my system on both depth 1 and depth N
displays.

Is my understanding in this case correct?  Can someone give me a rationale for
this design decision?  Thanks for any information.

    Sonia Lyris         sol@lucid.com	    415/329-8400

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/02/89)

    Is my understanding in this case correct?

Well, it is true that the depth of the tile must match that of the drawable,
but as to your really understanding, I'm not so sure.

    This, of course, requires me to have a tile pixmap of depth 1 AND the same
    tile pixmap of depth N if I expect to run my system on both depth 1 and
    depth N displays.

What exactly are you trying to do?  What's special about depth 1?  If you
want to run (and you should) on depth 4 and 8 and 12 and 16 and 24 and ...

    Can someone give me a rationale for this design decision?

What would you expect to happen if the tile was of a different depth?

sol@LUCID.COM (Sonia Lyris) (02/02/89)

What I would like to be able to do is to supply a depth 1 tiling
pixmap and have the server replicate the tile on the destination
no matter what depth the destination is.  Without that kind of
functionality I need to have a tile of every possible destination
depth on hand.  While this is not an awful hardship in this
particular case, I don't understand why the protocol doesn't
(I assume it doesn't) provide support for 1->N (N>1) tiling.
copy-plane, for example, does copy from a single plane to
a destination that need not be of depth 1.  However, since the
restriction on tiling is that the tile pixmap must be of the
same depth as the destination drawable, I cannot use copy-plane
for this purpose.

This, at least, is my understanding. Perhaps I am misunderstanding
the way things work.  Thanks for any enlightenment.

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/02/89)

    What I would like to be able to do is to supply a depth 1 tiling
    pixmap and have the server replicate the tile on the destination
    no matter what depth the destination is.

You still haven't made precise what you mean in this case, in terms
of exactly how the destination is affected.  However, I'll assume
from your later reference to copy-plane that what you mean is "use
the foreground and background pixels and the bitmap to construct a
real tile (essentially doing an opaque stipple), and then use that
tile".  The problem then is that, for a destination of depth 1, there
is an ambiguity: is the "tile" actually a tile, or should it be
reconstituted using the foreground and background pixels?  Rather
than trying to figure out how to resolve this ambiguity, the burden
is placed back on you to construct the tile yourself (e.g. by doing
a :bitmap put-image into the tile, or by doing a copy-plane into it).
It only takes a few lines of code to do this.