home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15418 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  1.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!uoft02.utoledo.edu!desire.wright.edu!jmatthews
  2. Newsgroups: comp.sys.mac.programmer
  3. Subject: Re: LockPixels() before every CopyBits()?
  4. Message-ID: <1992Sep12.232233.4076@desire.wright.edu>
  5. From: jmatthews@desire.wright.edu
  6. Date: 12 Sep 92 23:22:33 EST
  7. References: <1992Sep11.213220.23039@alias.com>
  8. Organization: Wright State University 
  9. Lines: 31
  10.  
  11. > Assuming that the address is okay, I noticed that we don't call
  12. > LockPixels() before CopyBits().  After inserting calls to LockPixels()
  13. > and UnlockPixels(), it looks something like this:
  14. >     HLock((Handle) pixHandle1);
  15. >     HLock((Handle) pixHandle2);
  16. >     LockPixels(pixHandle1);
  17. >     LockPixels(pixHandle2);
  18. >     CopyBits((BitMap *)*pixHandle1, (BitMap *)*pixHandle2, ...);
  19. >     UnlockPixels(pixHandle2);
  20. >     UnlockPixels(pixHandle1);
  21. >     HUnlock((Handle) pixHandle2);
  22. >     HUnlock((Handle) pixHandle1);
  23. > Now this seems to be a bit much for every call to CopyBits.
  24.  
  25. LockPixels and UnlockPixels should be suffucient; the HLock and
  26. HUnlock aren't needed. I think you may need to be calling
  27. GetGWorldPixMap instead of getting the pixMap directly (except
  28. under ColorQD version 1.2 where it's broken (see the Q & A stack)).
  29.  
  30. IM VI just says use GetGWorldPixMap without much explanation. I've
  31. imagined this makes a difference with GWorlds on graphic accelerators
  32. or temporary memory, but I don't really know.
  33.  
  34. Any thoughts?
  35.  
  36. o----------------------------------------------------------------------------o
  37. | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
  38. |      "Whom the gods would destroy, they first invite to program in C"      |
  39. o----------------------------------------------------------------------------o
  40.