tbm_surface_internal: refactor the creation of a surface