Speed up memory views in line drawing function