in case of layout invalidation, only compute layout infos if it is necessary