On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston <gwes...@mac.com> wrote:
> Iceberg-Dev wrote:
>
>>> When working with NSBitmapImageRep, calling -bitmapData is a signal
>>> that you may be editing the data. It is not repackaged until the
>>> bitmap is drawn, or somesuch. It's illegal to just stash a pointer
>>> to the data and use it arbitrarily later - that won't necessarily
>>> be the same data as now backs the image. This is described in the
>>> 10.6 AppKit release notes.
>>
>> Calling -bitmapData works on Mac OS X 10.5, it does not work on Mac
>> OS X 10.6. On 10.6, it's slow and the data gets zeroed. Bug?
>
> It would seem, but where is uncertain. I just threw something together to 
> access every byte of a 3MPixel image sequentially. It consistently took just 
> over 0.02s and did not result in data loss.

Well, on my MacBook Pro:

- it's slow
- it zeroes the data

and it crashes:

0   libSystem.B.dylib                   0x00007fffffe006c5 __bzero + 197
1   com.apple.Foundation                0x00007fff87909245
-[NSConcreteMutableData setLength:] + 214
2   com.apple.Foundation                0x00007fff87909155
-[NSConcreteMutableData initWithLength:] + 404
3   com.apple.AppKit                    0x00007fff86c03eae
NSNewBitmapBackingStore + 220
4   com.apple.AppKit                    0x00007fff86c3e4e2
-[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] + 191
5   com.apple.AppKit                    0x00007fff86c03d85
__-[NSBitmapImageRep
_withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_1
+ 341
6   com.apple.AppKit                    0x00007fff86b2f9a2
-[NSBitmapImageRep _performBlockUsingBacking:] + 45
7   com.apple.AppKit                    0x00007fff86c03c2c
-[NSBitmapImageRep
_withoutChangingBackingPerformBlockUsingBackingMutableData:] + 79
8   com.apple.AppKit                    0x00007fff86c03bc2
__-[NSBitmapImageRep
_performBlockUsingBackingMutableData:]_block_invoke_1 + 125
9   com.apple.AppKit                    0x00007fff86b2f9a2
-[NSBitmapImageRep _performBlockUsingBacking:] + 45
10  com.apple.AppKit                    0x00007fff86c03b41
-[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 79
11  com.apple.AppKit                    0x00007fff86c03aef
-[NSBitmapImageRep getBitmapDataPlanes:] + 79

Without calling - bitmapData, it's reasonably fast and does not crash.


Can you post your sample code?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to