On the breathers and rogue waves to a (2+1)-dimensional nonlinear Schrödinger equation with variable coefficients