SMask emulation

(list of affected issues can be generated via https://github.com/mozilla/pdf.js/issues?labels=4-smask&page=1&state=open and https://bugzilla.mozilla.org/buglist.cgi?quicksearch=d-smask&list_id=9257190)