home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!uoft02.utoledo.edu!desire.wright.edu!jmatthews
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: LockPixels() before every CopyBits()?
- Message-ID: <1992Sep12.232233.4076@desire.wright.edu>
- From: jmatthews@desire.wright.edu
- Date: 12 Sep 92 23:22:33 EST
- References: <1992Sep11.213220.23039@alias.com>
- Organization: Wright State University
- Lines: 31
-
- > 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.
-
- LockPixels and UnlockPixels should be suffucient; the HLock and
- HUnlock aren't needed. I think you may need to be calling
- GetGWorldPixMap instead of getting the pixMap directly (except
- under ColorQD version 1.2 where it's broken (see the Q & A stack)).
-
- IM VI just says use GetGWorldPixMap without much explanation. I've
- imagined this makes a difference with GWorlds on graphic accelerators
- or temporary memory, but I don't really know.
-
- Any thoughts?
-
- o----------------------------------------------------------------------------o
- | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
- | "Whom the gods would destroy, they first invite to program in C" |
- o----------------------------------------------------------------------------o
-