BEIJING — Americans view China in a markedly less favorable light than two years ago, and Chinese attitudes toward the United States have also soured, a sign that the two countries are drifting apart at the level of public opinion, according to a Pew Global Survey to be released on Thursday.