home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Subject: Re: Non-rectangular bitmaps/setting pixmap background...
- Message-ID: <1992Jul24.181510.29269@thunder.mcrcim.mcgill.edu>
- Organization: McGill Research Centre for Intelligent Machines
- References: <1992Jul13.194934.5605@news.cs.brandeis.edu> <raney.711494247@teal>
- Date: Fri, 24 Jul 92 18:15:10 GMT
- Lines: 55
-
- In article <raney.711494247@teal>, raney@teal.csn.org (Scott Raney) writes:
- > mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
- >> In article <1992Jul13.194934.5605@news.cs.brandeis.edu>, slanka@chaos.cs.brandeis.edu (Ishantha Lokuge) writes:
- >>> I am trying to create a non-rectangular bitmap...
- >> This is not possible. You'll have to get the effect you want some
- >> other way.
- > I say it *is* possible, but the process is nontrivial.
-
- A bitmap is a depth-1 pixmap. Pixmaps are, by definition, rectangular
- arrays of pixels. Thus, non-rectangular bitmaps don't exist any more
- than, say, OutputOnly windows do.
-
- > First, you need a mask of the shape you will be drawing, and a pixmap
- > of the size of your control to draw into. [...]
-
- This is an example of what I meant by getting the desired effect some
- other way.
-
- >> You will have to go about your ends some other way. There are
- >> various possibilities. One is to create a bitmap that is 1 where
- >> you want to change things when copying and 0 when not, then set this
- >> as the clip-mask in your GC, [...]
- > Unfortunately, the X server designers chose to implement clip masks
- > by converting them to rectangle lists instead of developing a three
- > element logic op.
-
- The *MIT sample server* designers chose to. Don't confuse this with X
- servers in general; there is no requirement that an X server do
- anything the way the MIT server does, as long as it follows the spec.
-
- This has come up on the net before. As I recall, it was done not to
- avoid three-element logic but to avoid *four*-element logic. Consider
- drawing stippled text, for example.
-
- > The result? Setting a full screen clip mask on a 386 takes several
- > seconds. Clipping a wide polyline to the mask can take several
- > *minutes*. If it had been implemented as a mask, the results would
- > be about 50% slower than regular operations. As it is, X clipmasks
- > are essentially useless.
-
- So don't complain; do something about it! If you were to contribute
- efficient code for doing clipmasks as masks, I'm sure lots of people
- would love you for it. (Of course, you also might, in the process,
- discover why it wasn't done that way - I don't know; I haven't looked
- at it at all.)
-
- It could also just be that your 386 is a pig. I've done circular
- clocks on the Sun-3/50 on my desk that are approximately a thousand
- pixels in diameter and it takes a second maybe, but not "several"
- seconds.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-