home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!utcsri!geac!alias!news
- From: Reid Ellis <rae@Alias.com>
- Subject: LockPixels() before every CopyBits()?
- Message-ID: <1992Sep11.213220.23039@alias.com>
- Sender: news@alias.com (News Owner)
- Organization: Alias Research, Inc., Toronto ON Canada
- Date: Fri, 11 Sep 1992 21:32:20 GMT
- Lines: 37
-
- 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?
-
- I'm off now to try it out. I'm kind of hoping the address is just
- invalid and not in VRAM :-)..
-
- Reid
- --
- Reid Ellis
- rae@utcs.utoronto.ca || rae@Alias.com
- CDA0610@applelink.apple.com || +1 416 362 9181 [work]
-