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)
const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow);
    let k = 0;
    const cl = new Uint8Array(3),
      cr = new Uint8Array(3);
    const c0 = colors[ci[0]],
      c1 = colors[ci[1]],
      c2 = colors[ci[2]],
      c3 = colors[ci[3]];
    const bRow = getB(splitYBy),
      bCol = getB(splitXBy);
    for (let row = 0; row <= splitYBy; row++) {
      cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0;
      cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0;
      cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0;
      cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0;
      cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0;
      cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0;
      for (let col = 0; col <= splitXBy; col++, k++) {
        if (
          (row === 0 || row === splitYBy) &&
          (col === 0 || col === splitXBy)
        ) {
          continue;
        }
        let x = 0,
          y = 0;
        let q = 0;
        for (let i = 0; i <= 3; i++) {
          for (let j = 0; j <= 3; j++, q++) {
            const m = bRow[row][i] * bCol[col][j];