home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!umn.edu!mmm.serc.3m.com!us277614
- From: us277614@mmm.serc.3m.com (Dave T. Berquist)
- Subject: Re: LockPixels() before every CopyBits()?
- Message-ID: <1992Sep13.223955.17262@mmm.serc.3m.com>
- Organization: 3M Company
- References: <1992Sep11.213220.23039@alias.com> <1992Sep12.232233.4076@desire.wright.edu>
- Date: Sun, 13 Sep 92 22:39:55 GMT
- Lines: 35
-
- In article <1992Sep12.232233.4076@desire.wright.edu> jmatthews@desire.wright.edu writes:
- >> 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?
- >
-
- GetGWorldPixMap should be used if system 7 is available, otherwise get
- the pixmap right from the gworld for system 6. (GetGWorldPixMap does
- not work under system 6 - I know, I have tried it).
-
- - Dave Berquist
-
-