Issue #76. Simplify cairo mask case.

Updated as per review comments. Changes are verified. Can be merged.