Some optimization for linear graphics