Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!labtam!graeme From: graeme@labtam.labtam.oz (Graeme Gill) Newsgroups: comp.windows.x Subject: Re: Window Managers Summary: Slightly more efficient Message-ID: <5691@labtam.labtam.oz> Date: 5 Dec 90 04:02:49 GMT References: <7422@castle.ed.ac.uk> <3055@gazette.bcm.tmc.edu> Organization: Labtam Information Systems Pty. Ltd., Melbourne, Australia Lines: 29 In article <3055@gazette.bcm.tmc.edu>, etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes: > > The general concept is that you draw a line using > GXXor. You draw a line the first time and it inverts > the colors beneath it. The draw the same line in > exactly the same place again and the colors invert > again giving you the original pixels. The GC for drawing this line is as follows : Pixel white = WhitePixel(dpy,screen) ; Pixel black = BlackPixel(dpy,screen) ; values.foreground = black ^ white ; values.background = white ; values.line_width = 0 ; values.function = GXxor ; values.plane_mask = values.foreground ; ^^^^^^^^^^^^^^^^^ etc. Setting the plane mask is both un-necessary, and potentially slow on some systems. Systems with screen pixmap depth > 1 may or may not have hardware support for the plane mask, hence it is best to leave all planes enabled. Setting the foreground to the xor of the two colours concerned is sufficient to restrict the operation to the appropriate planes. Graeme Gill Labtam I. S. Pty. Ltd.