I was wondering if WebGL is considered stable enough to be enabled by default. It makes some PDFs render much faster and it has been off by default for a while now, so we have had quite some time to test it.

If we decide to enable WebGL by default, we should not forget to update https://github.com/mozilla/pdf.js/blob/master/extensions/chromium/preferences_schema.json#L39 as well.

/cc @yurydelendik 
/cc @Snuffleupagus (because IIRC you were testing WebGL too)

bounds,
    combinesScale,
    coords,
    colors,
    figures,
    backgroundColor,
    cachedCanvases,
    webGLContext
  ) {
    
    
    const EXPECTED_SCALE = 1.1;
    
    const MAX_PATTERN_SIZE = 3000; 
    
    
    const BORDER_SIZE = 2;
    const offsetX = Math.floor(bounds[0]);
    const offsetY = Math.floor(bounds[1]);
    const boundsWidth = Math.ceil(bounds[2]) - offsetX;
    const boundsHeight = Math.ceil(bounds[3]) - offsetY;
    const width = Math.min(
      Math.ceil(Math.abs(boundsWidth * combinesScale[0] * EXPECTED_SCALE)),
      MAX_PATTERN_SIZE
    );
    const height = Math.min(
      Math.ceil(Math.abs(boundsHeight * combinesScale[1] * EXPECTED_SCALE)),
      MAX_PATTERN_SIZE
    );
    const scaleX = boundsWidth / width;