Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!rosie!NeXT.COM From: Peter_King@NeXT.COM (Peter King) Newsgroups: comp.sys.next Subject: Re: How do you draw lines into the current view for Rubberbanding Message-ID: <836@rosie.NeXT.COM> Date: 29 May 91 00:33:09 GMT References: <507@heaven.woodside.ca.us> Sender: news@NeXT.COM Lines: 43 Nntp-Posting-Host: palantir.next.com In article <507@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes: > > I'm curious; why isn't instance drawing implemented to avoid flickering in > the manner you suggest? It seems that this would be a better > implementation, and just as easy, unless I'm missing something. > I wasn't there when the instance drawing mechanism was designed, but I suppose it is a classic "aesthetics vs. performance" tradeoff. An example of this kind of tradeoff is the different styles of window buffering available (Buffered/Retained/NonRetained). You can get a cleaner, snappier look if you are willing to pay in virtual memory for the buffered window. In a demand-paged system such as NeXT's, using more virtual memory effects the performance of the overall system. When you do double-buffered compositing for dynamic drawing, you need to allocate an off-screen window to hold the on-screen window's current state. Let's look at a worst-case scenario: we are writing a Draw like program that works in color on the NeXTdimension. An 8.5 by 11 page will take 612 pixels * 792 pixels * 4 bytes per pixel = 1938816 bytes Almost 2MB for the off-screen window. This will undoubtably cause paging to happen. If you have limited physical memory, this may not perform as fast as needed. Instance drawing gives you the option of using the window's backing store to erase from so you can avoid burning memory for the off-screen window. The tradeoff is that you get flicker. As with a lot of performance critical areas in NeXTstep application design, NeXT has provided the developer with a set of alternatives. Only the developer knows which alternative is appropriate for his or her application. If the flicker is unacceptable, use double-buffering. Peter ----------Disclaimers? Always. Everything's Subjective---------- Peter F. King Developer Trainer NeXT Computer, Inc. USPS: 900 Chesapeake Dr. Redwood City, CA 94063 Internet: Peter_King@NeXT.COM