home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!newsflash.concordia.ca!sifon!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Subject: Re: new FAQ? (programming) masking Pixmaps *efficiently*
- Message-ID: <1992Dec18.012904.15093@thunder.mcrcim.mcgill.edu>
- Keywords: Pixmap, mask, bitmap, graphic context
- Organization: McGill Research Centre for Intelligent Machines
- References: <1g45bpINNavm@agate.berkeley.edu> <1992Dec15.152852.2528@miki.pictel.com>
- Date: Fri, 18 Dec 92 01:29:04 GMT
- Lines: 53
-
- In article <1992Dec15.152852.2528@miki.pictel.com>, oj@miki.pictel.com (Oliver Jones) writes:
- > In article <1992Dec11.180230.10091@elroy.jpl.nasa.gov> sns@bondi.jpl.nasa.gov (Sam Southard) writes:
-
- >> Since my application will have arbitrarily-sized images, I decided
- >> that I would use the clip_mask.
- > Good call!
-
- In a conceptual sense, yes. This is what clip-masks are for: clipping.
- Unfortunately,
-
- > Der Mouse wrote:
- >> The server in question is probably doing the common thing and
- >> converting clip-masks to rectangle lists.
- > This is done, behind your back, in the server.
-
- Yes...but the choice of this implementation means that clip-masks that
- don't decompose nicely into rectangles will be expensive to set and
- somewhat expensive to use.
-
- This implementation of clipping made sense in R3, before SHAPE, when
- most clipping regions were the union of a few rectangles, though even
- then, using it for client-specified GC clip masks (which are reasonably
- likely to be complex) strikes me as at least questionable, requiring
- further examination and thought.
-
- >> Must I retain all graphics commands and re-issue them when an area
- >> of the window is exposed?
- > In general, yes, you must.
-
- Well, you can use a pixmap to cache the results of the drawing on the
- server. This has its price, of course: slower drawing (because you
- have to draw to both the window and the pixmap) and memory use.
-
- >> I had planned on retaining a pixmap with the window contents for
- >> this purpose.
- > OK, but all drawing will have to take place first to the window, then
- > to the pixmap.
-
- Well, you could draw to the pixmap first - it makes no difference, as
- long as you don't copy from one to the other in between drawing
- something to one and drawing it to the other.
-
- > X gives you no reliable way to copy stuff from the window to the
- > pixmap in such a way that the pixmap is a true copy of the window.
-
- I wonder if it would be worthwhile to provide a way to tell the server
- "here's a pixmap, use it as if it were backing-store for this
- window"...might be worth thinking about.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-