surface may be NULL in TextSurface.