home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!terminator!krk
- From: krk@itl.itd.umich.edu (Kenneth Knight)
- Subject: Re: LockPixels() before every CopyBits()?
- Message-ID: <1992Sep12.222527.16562@terminator.cc.umich.edu>
- Sender: news@terminator.cc.umich.edu (Usenet Owner)
- Organization: Instructional Technology Laboratory, University of Michigan
- References: <1992Sep11.213220.23039@alias.com>
- Date: Sat, 12 Sep 1992 22:25:27 GMT
- Lines: 35
-
- In article <1992Sep11.213220.23039@alias.com> Reid Ellis <rae@Alias.com> writes:
- >Inside Mac V says that LockPixels() must be called before drawing into
- >an offscreen GWorld. And yet the examples within the next few pages
- >don't call LockPixels()! What's the scoop here?
- >
- >I think I've tracked down a bug in our program where it crashes on a
- >Quadra 700 but not on a IIci during a call to CopyBits(). On the
- >Quadra, the baseAddr of one of the bitmaps was F9001000, which was way
- >out of line with other addresses. I would guess it's either invalid
- >or the address of the built-in VRAM. I can't find any doc that says
- >"The 32-bit address of the Quadra's VRAM is xxxx".
- >
- >Assuming that the address is okay, I noticed that we don't call
- >LockPixels() before CopyBits(). After inserting calls to LockPixels()
- >and UnlockPixels(), it looks something like this:
- >
- > HLock((Handle) pixHandle1);
- > HLock((Handle) pixHandle2);
- > LockPixels(pixHandle1);
- > LockPixels(pixHandle2);
- > CopyBits((BitMap *)*pixHandle1, (BitMap *)*pixHandle2, ...);
- > UnlockPixels(pixHandle2);
- > UnlockPixels(pixHandle1);
- > HUnlock((Handle) pixHandle2);
- > HUnlock((Handle) pixHandle1);
- >
- >Now this seems to be a bit much for every call to CopyBits. Is this
- >trip really necessary? Would it be quicker to check to see is each
- >PixMapHandle is offscreen?
-
- You can remove the HLock/HUnlcok calls certainly. I'd keep the LockPixels/
- UnlockPixels() calls in place.
-
- ** Ken **
-
-