try using xlib surface vs image surface.

./a.out 1 for image
./a.out   for xlib