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



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

Michael
Orbital Launch & Lift, Inc.
The MacOS X setuid Helper Tool Experts
http://www.orbitallaunch.com

At 5:38 PM -0700 7/29/04, John Stiles wrote:
>On Jul 29, 2004, at 5:21 PM, OL&L Lists wrote:
>
>> I don't think that's true. Any call that modifies the port's bits
>> directly should always be bracketed by lock/unlock calls:
>>
>> http://developer.apple.com/documentation/Carbon/Reference/
>> QuickDraw_Ref/qdref_main/function_group_3.html#//apple_ref/c/func/
>> LockPortBits
>>
>> "If you're writing code that reads or modifies the port bits
>> directly, you should bracket your code with calls to this function
>> and UnlockPortBits."
>
>"Modifying the port bits directly" means assigning to them without
>using QuickDraw, i.e. via a custom blitter. Any QuickDraw call will do
>the right thing without an explicit need to lock and unlock.
>
>You may see a performance benefit if you manually lock, since QuickDraw
>will lock and unlock between every single operation (it doesn't know
>how many things you plan on doing with the port). But unless you are
>by-hand overwriting pixels, you do not need to concern yourself with
>this.
>
>> From experience it sounds to me more like you have a SetPort problem.
>
>I agree; IMO the OP's problem is probably caused by not setting the
>port properly before the CopyBits...
_______________________________________________
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>)



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.