Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread Matt Neuburg
On or about 8/29/10 2:54 PM, thus spake "Ken Ferry" : > In practice at the moment, a CGLayer is basically a CGImage together with a > CGBitmapContext.  I can think of case where something different happens, but > that case still doesn't use the GPU. Cool, once again I got the education I was afte

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread Ken Ferry
On Sun, Aug 29, 2010 at 2:10 PM, David Duncan wrote: > On Aug 29, 2010, at 11:21 AM, Matt Neuburg wrote: > > > On or about 8/28/10 9:31 PM, thus spake "David Duncan" > > : > > > >> it is usually far more > >> useful to use a hardware cache, which means CALayer or UIView, not > CGLayer. > > > > Sor

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread David Duncan
On Aug 29, 2010, at 11:21 AM, Matt Neuburg wrote: > On or about 8/28/10 9:31 PM, thus spake "David Duncan" > : > >> it is usually far more >> useful to use a hardware cache, which means CALayer or UIView, not CGLayer. > > Sorry to keep coming back to this, but the documentation implies that > CG

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread Matt Neuburg
On or about 8/28/10 9:31 PM, thus spake "David Duncan" : > it is usually far more > useful to use a hardware cache, which means CALayer or UIView, not CGLayer. Sorry to keep coming back to this, but the documentation implies that CGLayer *is* a hardware cache - that's why I was using it. For exam

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread David Duncan
I would recommend you file a bug. -- David Duncan On Aug 29, 2010, at 9:38 AM, Matt Neuburg wrote: > On or about 8/28/10 9:31 PM, thus spake "David Duncan" > : > >> In the case of iOS for example, caching contents to CGLayers is rarely useful >> because it is rarely useful to use a software ca

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread Matt Neuburg
On or about 8/28/10 9:31 PM, thus spake "David Duncan" : > In the case of iOS for example, caching contents to CGLayers is rarely useful > because it is rarely useful to use a software cache ­ it is usually far more > useful to use a hardware cache, which means CALayer or UIView, not CGLayer. I b

Re: CGLayer resolution on iPhone with Retina display

2010-08-29 Thread Alex Kac
Ah, I just read the Layer part and didn’t think of a CGLayer. You are right - a CGLayer has nothing in common. That’s what I get for reading too quickly. On Aug 28, 2010, at 9:18 PM, Matt Neuburg wrote: > > On Aug 28, 2010, at 1:37 PM, Alex Kac wrote: > >> I believe you need to set the scale o

Re: CGLayer resolution on iPhone with Retina display

2010-08-28 Thread David Duncan
On Aug 28, 2010, at 1:22 PM, Matt Neuburg wrote: > In my UIView's drawRect: I derive a CGLayer from the current context, draw > into it, and then draw the layer into the context (the view). Out of curiosity is there any particular reason you are taking this approach? -- David Duncan ___

Re: CGLayer resolution on iPhone with Retina display

2010-08-28 Thread Matt Neuburg
On Aug 28, 2010, at 1:37 PM, Alex Kac wrote: > I believe you need to set the scale of the layer to the scale of the device. > Here is how we do it where appContentScaleFactor is a global variable we > store the scale from at startup: > > if ([[UIScreen mainScreen] respondsToSelector: @se

Re: CGLayer resolution on iPhone with Retina display

2010-08-28 Thread Alex Kac
I believe you need to set the scale of the layer to the scale of the device. Here is how we do it where appContentScaleFactor is a global variable we store the scale from at startup: if ([[UIScreen mainScreen] respondsToSelector: @selector(scale)]) appContentScaleFactor =

CGLayer resolution on iPhone with Retina display

2010-08-28 Thread Matt Neuburg
In my UIView's drawRect: I derive a CGLayer from the current context, draw into it, and then draw the layer into the context (the view). This still works on iPhone with a Retina display, but the drawing is blocky. You can see the problem perfectly with Apple's own example code (DrawFlag) in the CGL