Implements shading types 4-7

(list of issues https://github.com/mozilla/pdf.js/issues?labels=4-shading-pattern&page=1&state=open and https://bugzilla.mozilla.org/buglist.cgi?quicksearch=d-shading-pattern&list_id=9290423)

TODO:
- <del>[x] land #4189 and rebase</del>
- <del>[x] invert picture (see #2948)</del>
- <del>[x] type 6 (see #1950)</del>