Add support for filters (based on cairo source).

Yet to be tested (need a test case).