The Instruments User Guide has this to say:
- Color Copied Images. Puts a cyan overlay over images that were copied by Core Animation.
But that doesn't explain why an image got copied. There doesn't seem to be an obvious pattern from one copied image to another, although it is regular and reproducible.
The docs currently don't even mention Color Hits Green and Misses Red, but I'm thinking it might have something to do with CALayer
’s shouldRasterize
property.
Any ideas?
For "Color Copied Images," this was talked about nicely in Session 419 WWDC 2014:
"If an image is in a color format that the GPU can not directly work with, it will be converted in the CPU."
Example: Imagine getting images from an online source where you don't control the format. JPEG supports 24-bit color images (8 bits per color). TIFF format can store colors in 48-bit color images (16 bits per color). Depending on what iOS wants, these differences might have to be converted.
The solution would be to covert them in the background to the right color format to prevent a performance problem of doing these conversions on the main thread.
For "Color Hits Green and Misses Red," OP is correct, it's to check whether you are using the "shouldRasterize" property correctly. Green means good, you re-used the cache you created from the "shouldRasterize" property. Red means bad, you needed to write to the cache (causes an offscreen pass), and then draw.