Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: QuickDraw/TextEdit question Message-ID: <29943@ucbvax.BERKELEY.EDU> Date: 4 Jul 89 17:56:54 GMT References: <3705@lindy.Stanford.EDU> <14190@dartvax.Dartmouth.EDU> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 16 In article <14190@dartvax.Dartmouth.EDU> earleh@eleazar.dartmouth.edu (Earle R. Horton) writes: > This is because TextEdit calls EraseRect before calling DrawText. >The srcOr mode is ORing bits into a freshly erased background! But don't depend on this: It doesn't always call EraseRect(), so if you need it erased, you might have to do it yourself. Since you need it not erased, just aim the TERec at an offscreen GrafPort, and after each keystroke, CopyBits the background to a work offscreen GrafPort, CopyBits the text on top, and CopyBits the result to the screen. Since the first two CopyBits never need to worry about clipping, you can do them with Moves and Ors, or tight asssembly language Move.l & OR.l loops, or unroll the loops for more speed. To really go fast, use QuickDraw bottleneck procedures in the TE's offscreen port to keep track of the bound box that needs to be updated.