Propagate cairo1 -> cairo , cairo -> cairo2 changes introduced by #997

Fix #999
Merge pull request #1000 from samoht/master

Propagate cairo1 -> cairo , cairo -> cairo2 changes introduced by #997