Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!agate!web8h.berkeley.edu!adamj From: adamj@web8h.berkeley.edu (Adam J. Richter) Newsgroups: comp.windows.x Subject: Re: Graphics Context in X11 Message-ID: <6799@agate.BERKELEY.EDU> Date: 31 Jan 88 06:29:15 GMT References: <5163X@utah-cs.UUCP> Sender: usenet@agate.BERKELEY.EDU Reply-To: adamj@widow.berkeley.edu (Adam J. Richter) Organization: University of California, Berkeley Lines: 32 Keywords: caching, cost In article <5163X@utah-cs.UUCP> shebs@utah-cs.UUCP (Stanley Shebs) writes: >The X11 Xlib document warns against using too many graphics contexts and >switching between them, as opposed to re-setting the attributes of a few. Good advice if you're using the server that I've been porting for Jupiter Systems ("graphics far beyond your puny earthling needs."). Their system has eight cached GCs. (Some of them are used by server GCs to do things like drawing the cursor; in practice, you'll have fewer.) While I think that GCs are a good idea, I don't think that there is a good general rule for GC usage. If there are free hardware GCs, then, obviously, you want use them. If there are more software GCs than hardware GCs and a lot of software GCs are being accessed, then you'll "thrash." It's just like physical and virtual memory. As for the Jupiter, it can change parts of a GC element-by-element, so changing the GC is cheap. On the other hand, if you were using a system in which you could only load hardware GCs whole-hog, then it would always be better to use separate GCs. This sort of hardware information might be useful to ask for in the form of an extension. On the other hand, I'm hoping for a public-domain NeWS. P.S.--> Has anybody out there noticed that all the X protocol requests, except the ellipse stuff, can be generalized to N dimensions? Adam J. Richter adamj@widow.berkeley.edu ....!ucbvax!widow!adamj Home: (415)549-6377 Work: (415)523-9000 Sun room: (415)642-7762