optimized drawPath