Improve Surface.__init__.

It now properly take account of flags and sample surfaces.