Re: CALayer contentScale initialization, where to do it?
contentsScale won't matter until you the layer into a window, so why not just assign it when you add the layer as a sublayer? -- David Duncan @ My iPhone On Jun 16, 2012, at 10:57 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On 6/16/12 11:59 PM, Kyle Sluder wrote: That's the same document I was referring to. But it also contains this very useful section, titled Manage Core Animation Layer Contents And Scale: https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27 Specifically, it looks like you want to implement -layer:shouldInheritContentsScale:fromWindow: on your layer delegates. I know, see my first message. It's the initialization I'm talking about, this delegate helps when contentsScale changes. Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com This email sent to david.dun...@apple.com ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
On 6/17/12 9:15 AM, David Duncan wrote: contentsScale won't matter until you the layer into a window, so why not just assign it when you add the layer as a sublayer? That works for sub-layers if the root has been set up already, but when do you suggest to set the view's root layer contentsScale? Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it? (SOLVED)
On 6/17/12 9:15 AM, David Duncan wrote: contentsScale won't matter until you the layer into a window, so why not just assign it when you add the layer as a sublayer? Turns out that my problem was caused by the time the NSView's root layer was set up: In previous AppKit versions, NSView's -setLayer: -wantsLayer: needed to be outside of -initWithFrame: because for whatever reason, setting it up in -initWithFrame: didn't work (it simply was reset). On Lion this seems to have been fixed - which I didn't realize before - and the contentsScale of the root layer and its sub-layers is set by the framework automatically during view initialization/nib loading. So problem solved, thanks guys! Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
Same concept applies. Set it when you assign the layer or add the view. -- David Duncan @ My iPhone On Jun 17, 2012, at 12:55 AM, Markus Spoettl ms_li...@shiftoption.com wrote: On 6/17/12 9:15 AM, David Duncan wrote: contentsScale won't matter until you the layer into a window, so why not just assign it when you add the layer as a sublayer? That works for sub-layers if the root has been set up already, but when do you suggest to set the view's root layer contentsScale? Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
On Jun 16, 2012, at 4:13 AM, Markus Spoettl ms_li...@shiftoption.com wrote: I usually create the layers (if there's a fixed number of them) in the view's -initWithFrame:. At that point the view doesn't have a window, so I can't set contentScale correctly (by getting the window's backingScaleFactor). Is this strategy documented somewhere? The High-Resolution Guide says to avoid looking at the windows backingScaleFactor at all, but it's very sparse on details about supporting CALayer. --Kyle Sluder ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
On 6/16/12 8:08 PM, Kyle Sluder wrote: I usually create the layers (if there's a fixed number of them) in the view's -initWithFrame:. At that point the view doesn't have a window, so I can't set contentScale correctly (by getting the window's backingScaleFactor). Is this strategy documented somewhere? The High-Resolution Guide says to avoid looking at the windows backingScaleFactor at all, but it's very sparse on details about supporting CALayer. https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html talks a little about layers but is rather unclear on how and when to initalize a layer contentScale properly. I don't recall reading about avoiding backingScaleFactor, though. Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
On Jun 16, 2012, at 1:53 PM, Markus Spoettl ms_li...@shiftoption.com wrote: On 6/16/12 8:08 PM, Kyle Sluder wrote: I usually create the layers (if there's a fixed number of them) in the view's -initWithFrame:. At that point the view doesn't have a window, so I can't set contentScale correctly (by getting the window's backingScaleFactor). Is this strategy documented somewhere? The High-Resolution Guide says to avoid looking at the windows backingScaleFactor at all, but it's very sparse on details about supporting CALayer. https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Introduction/Introduction.html That's the same document I was referring to. But it also contains this very useful section, titled Manage Core Animation Layer Contents And Scale: https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27 Specifically, it looks like you want to implement -layer:shouldInheritContentsScale:fromWindow: on your layer delegates. --Kyle Sluder ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer contentScale initialization, where to do it?
On 6/16/12 11:59 PM, Kyle Sluder wrote: That's the same document I was referring to. But it also contains this very useful section, titled Manage Core Animation Layer Contents And Scale: https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW27 Specifically, it looks like you want to implement -layer:shouldInheritContentsScale:fromWindow: on your layer delegates. I know, see my first message. It's the initialization I'm talking about, this delegate helps when contentsScale changes. Regards Markus -- __ Markus Spoettl ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com