Link to PDF file (or attach file here):
[gradient invisible pdfjs.pdf](https://github.com/mozilla/pdf.js/files/1096729/gradient.invisible.pdfjs.pdf)

Configuration:
- Web browser and its version: 59.0.3071.109
- Operating system and its version: Windows 10
- PDF.js version: 1.8.480
- Is an extension: No

Steps to reproduce the problem:
1. Open the file in Adobe Reader or Google Chrome
2. Open the file in PDFjs online viewer
3. Compare

What is the expected behavior? (add screenshot)
- There is an orange radial gradient, from opacity 0 at the center to opacity 1 at the page bound

![image](https://user-images.githubusercontent.com/17966696/27466423-3923639e-57e3-11e7-841f-7f498732bb20.png)

What went wrong? (add screenshot)
- The gradient is completely missing

![image](https://user-images.githubusercontent.com/17966696/27466446-63e36606-57e3-11e7-86c3-9a5e0b6b0e0a.png)

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
http://mozilla.github.io/pdf.js/web/viewer.html

Description of the file:
An opaque orange gradient is masked with a mask. The mask's group contains a rectangle filled with a pattern. The pattern contains an other rectangle filled with a greyscale gradient from black to white. All the rectangles, patterns & groups have the same size as the page (400x400pt).
c3 = tmp;
    }
    if (coords[p1 + 1] > coords[p2 + 1]) {
      tmp = p1;
      p1 = p2;
      p2 = tmp;
      tmp = c1;
      c1 = c2;
      c2 = tmp;
    }
    const x1 = (coords[p1] + context.offsetX) * context.scaleX;
    const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;
    const x2 = (coords[p2] + context.offsetX) * context.scaleX;
    const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;
    const x3 = (coords[p3] + context.offsetX) * context.scaleX;
    const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;
    if (y1 >= y3) {
      return;
    }
    const c1r = colors[c1],
      c1g = colors[c1 + 1],
      c1b = colors[c1 + 2];
    const c2r = colors[c2],
      c2g = colors[c2 + 1],
      c2b = colors[c2 + 2];
    const c3r = colors[c3],
      c3g = colors[c3 + 1],
      c3b = colors[c3 + 2];
    const minY = Math.round(y1),
      maxY = Math.round(y3);