I have created a 800x1200 context using this line:
CGSize sizeX = CGSizeMake(800, 1200);
CGLayerRef objectLayer = CGLayerCreateWithContext (context, sizeX, NULL);
over this context I have a CGLayer that is 2250x2250 pixels.
This layer (objectLayer) is drawn using something like
CGRect LayerRect = CGRectMake(0,0, layerW, layerH);
CGContextDrawImage(objectContext, LayerRect, myImage.image.CGImage);
CGRect superRect = CGRectMake(0,0, sizeW, sizeH);
CGContextDrawLayerInRect(context, superRect, objectLayer);
according to my math, a 800x1200 context at 24 bpp, should be using 2.8 Mb and a 2250x2250 layer at 32 bpp should be using 20 Mb. So, in total both should be using about 23 Mb.
The problem is that instruments report just the layer to be using 38.62 Mb !!!!
How can that be? Is that some I am missing?
thanks for any help.