views:

361

answers:

1

Instruments tells that there are "misaligned images" which are animated by core animation. What does that mean?

UPDATE: I've seen that in Instruments.app > Core Animation.

+4  A: 

I'd love more information about where you're seeing this, but my suspicion is that it's referring to an image that is not pixel-aligned. Quartz allows you to draw at fractional pixels (recall that CGPoint takes CGFloats, not NSIntegers), but it's more expensive and tends to create a bit of blurriness. You can't really draw on a fractional pixel, so Quartz has to do anti-aliasing to pull it off. That takes time and certainly would hurt Core Animation performance.

Quartz will not warn you that you're drawing on fractional pixels, and it's particularly unkind to text. So it's something you need to think about any time you're doing programmatic layout.

Rob Napier
Yup, that's what misaligned image means.
Kriem
Thanks for the hint. Indeed I had floating point values for frame origin coordinates. After wrapping them by an floor() the message in Insturment disappeared. But I could not recognize any performance improvement. Instruments complains about this also when an UIImageView gets rotated. So I think it's nothing too bad ;)
Thanks
It is true when any scaling occurs - for instance if the width or height of an image view don't match the source image bounds, or when a view has an affine transformation applied.
Paul Alexander