Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Help: Using CopyBits for Update Message-ID: <7254@hoptoad.uucp> Date: 11 May 89 21:25:22 GMT References: <1617@neoucom.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 29 Maybe I'm being dense, but what is the advantage to keeping an offscreen bitmap in a terminal emulator and using it for updates? Individual updates will go faster. However, you will spend more time overall in QuickDraw, because what would ordinarily be a one-step process has a new step added. The alternative to using an offscreen bitmap is to draw the characters directly into the window. This takes a time we'll call Td. The time Td is going to be about the same whether you're drawing to the screen or to an offscreen bitmap. However, when drawing offscreen, you need another step, a CopyBits to the screen, which takes time Tc. So the overall drawing time using the offscreen bitmap approach is Td+Tc, while drawing directly to the window is Td only. If a dialog box or something comes up in front of your window, then goes away, then the offscreen bitmap approach will lead to a faster update of the covered region, because Tc < Td. However, this seems to be the only case where you'd get a speedup. (And related cases like going to the back in MultiFinder then coming back to the front.) Most of the time in a terminal emulator in real life, you're likely to be writing to the front window. And I haven't even mentioned that the 20K or so for the offscreen bitmap is likely to impose a speed hit on your software because there's less free space in the heap.... -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "Prisons are built with stones of Law, Brothels with bricks of Religion." - Blake, "The Marriage of Heaven and Hell"