layers tree iteration and painting each layer with native ios layer graphic context