Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CopyBits and dual monitor configration



On Jul 29, 2004, at 7:51 PM, OL&L Lists wrote:

> Locking the pixels in a pixmap is *always* mandatory before passing
> that pixmap to CopyBits. The reason is that the call to CopyBits can
> move memory - including the actual pixels in the pixmaps.
>
> See the sample listing at:
>
> http://developer.apple.com/documentation/mac/QuickDraw/QuickDraw
> -304.html#MARKER-9-27

I'm sorry, but you are just not correct in this case. The CopyBits
call will lock the pixels for you if you have not already done so.

The reason that the code you are looking at on that page uses
LockPixels is because it is drawing into an Offscreen GWorld. With an
offscreen GWorld. The Offscreen GWorld may have been created such that
it's pixels are purgeable. In the case of a purgeable Offscreen GWorld
the LockPixels will insure that the pixel buffer is available for you
to use by allocating them if they have been purged. That's why
LockPixels returns a Boolean. If the pixels were purged and cannot be
reallocated then LockPixels will return false.

For this reason it is a good practice to call LockPixels on an
offscreen GWorld on Mac OS 9.

On Mac OS X it is just as unlikely that the pixels will have been
purged as it is unlikely that they will move in memory.

Scott

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: CopyBits and dual monitor configration (From: John Stiles <email@hidden>)
 >Re: CopyBits and dual monitor configration (From: OL&L Lists <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.