Attach (recommended) or Link to PDF file here:
[bug.pdf](https://github.com/mozilla/pdf.js/files/2886648/bug.pdf)
Also available at https://bug1529152.bmoattachments.org/attachment.cgi?id=9045439


Configuration:
- Web browser and its version: Firefox Nightly 67.0a1 (2019-02-20) (64-bit)
- Operating system and its version: Linux (64-bit Ubuntu 18.10)
- PDF.js version: whatever is bundled with current Nightly
- Is a browser extension: No (using built-in version, which is not listed in extensions)

Steps to reproduce the problem:
1. View [attached PDF](https://github.com/mozilla/pdf.js/files/2886648/bug.pdf)) in PDF.js (e.g. via Firefox Nightly built-in PDF viewer).  It's also hosted here: https://bug1529152.bmoattachments.org/attachment.cgi?id=9045439
This PDF was generated from an [HTML testcase](https://bugzilla.mozilla.org/attachment.cgi?id=9045438) that has a repeating-linear-gradient with "hard stops" (0-100px all the same color, 100-200px all the same color, & repeat)

What is the expected behavior?
There should be **solid stripes** of blue and lime.  There shouldn't be any blurring between the colors.  I think there should be 6 total stripes, though different viewers seem to disagree (Safari+Edge render 6 stripes; Chrome renders a tiny blue stripe at the top; Evince renders 3 broad stripes)  But bottom line, there should be distinct solid-colored stripes. Here's a screenshot of the Chrome built-in PDF viewer's rendering:
![image](https://user-images.githubusercontent.com/426803/53128057-c8735680-3518-11e9-82fa-f75d733bda44.png)

What went wrong?
PDF.js renders a gradual gradient from lime to blue (but mostly lime).  Here's a screenshot:
![image](https://user-images.githubusercontent.com/426803/53127935-6f0b2780-3518-11e9-8f77-6d1998150ee0.png)
case 2:
          tmp1 = ps[15];
          tmp2 = ps[11];
          ps[12] = ps[3];  ps[13] = pi + 0; ps[14] = pi + 1;   ps[15] = pi + 2;
          ps[ 8] = ps[7];   ps[11] = pi + 3;
          ps[ 4] = tmp2;    ps[ 7] = pi + 4;
          ps[ 0] = tmp1;  ps[ 1] = pi + 7;   ps[ 2] = pi + 6;  ps[ 3] = pi + 5;
          tmp1 = cs[3];
          cs[2] = cs[1]; cs[3] = ci;
          cs[0] = tmp1;  cs[1] = ci + 1;
          break;
        
        case 3:
          ps[12] = ps[0];  ps[13] = pi + 0;   ps[14] = pi + 1; ps[15] = pi + 2;
          ps[ 8] = ps[1];   ps[11] = pi + 3;
          ps[ 4] = ps[2];   ps[ 7] = pi + 4;
          ps[ 0] = ps[3];  ps[ 1] = pi + 7;   ps[ 2] = pi + 6; ps[ 3] = pi + 5;
          cs[2] = cs[0]; cs[3] = ci;
          cs[0] = cs[1]; cs[1] = ci + 1;
          break;
      }
      
      ps[5] = coords.length;
      coords.push([
        (-4 * coords[ps[0]][0] -
          coords[ps[15]][0] +
          6 * (coords[ps[4]][0] + coords[ps[1]][0]) -
          2 * (coords[ps[12]][0] + coords[ps[3]][0]) +
          3 * (coords[ps[13]][0] + coords[ps[7]][0])) /
          9,