mozilla/pdf.js — pull request #4355 by nnethercote (2014-02-28 06:38:54+00:00)
Title: Put mask data to the canvas in small slices.

In pull #4138, I changed image drawing to be in small chunks, to avoid creating large copies of the image data.

This patch does the same thing for image masks. I have two test documents that use masks, which I test by scrolling through the whole document and measuring peak RSS. The improvements were:

- ~380 to ~290 MiB
- ~370 to ~260 MiB