message: Add multisample property to Renderer
diff: @@ -14,7 +14,7 @@ import { ShaderSystem } from './shader/ShaderSystem';
  import { ContextSystem } from './context/ContextSystem';
  import { BatchSystem } from './batch/BatchSystem';
  import { TextureGCSystem } from './textures/TextureGCSystem';
  -import { RENDERER_TYPE } from '@pixi/constants';
  +import { MSAA_QUALITY, RENDERER_TYPE } from '@pixi/constants';
  import { UniformGroup } from './shader/UniformGroup';
  import { Matrix, Rectangle } from '@pixi/math';
  import { Runner } from '@pixi/runner';
  @@ -77,6 +77,7 @@ export class Renderer extends AbstractRenderer
  public globalUniforms: UniformGroup;
  public CONTEXT_UID: number;
  public renderingToScreen: boolean;
  + public multisample: MSAA_QUALITY;
  // systems
  public mask: MaskSystem;
  public context: ContextSystem;
  @@ -182,6 +183,8 @@ export class Renderer extends AbstractRenderer
  resize: new Runner('resize'),
  };
  + this.runners.contextChange.add(this);
  +
  /**
  * Global uniforms
  * @member {PIXI.UniformGroup}
  @@ -299,6 +302,13 @@ export class Renderer extends AbstractRenderer
  this.initPlugins(Renderer.__plugins);
  + /**
  + * The number of msaa samples of the canvas.
  + * @member {PIXI.MSAA_QUALITY}
  + * @readonly
  + */
  + this.multisample = undefined;
  +
  /*
  * The options passed in to create a new WebGL context.
  */
  @@ -331,6 +341,51 @@ export class Renderer extends AbstractRenderer
  this.resize(this.options.width, this.options.height);
  }
  + protected contextChange(): void
  + {
  + const gl = this.gl;
  +
  + let samples;
  +
  + if (this.context.webGLVersion === 1)
  + {
  + const framebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);
  +
  + gl.bindFramebuffer(gl.FRAMEBUFFER, null);
  +
  + samples = gl.getParameter(gl.SAMPLES);
  +
  + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
  + }
  + else
  + {
  + const framebuffer = gl.getParameter(gl.DRAW_FRAMEBUFFER_BINDING);
  +
  + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
  +
  + samples = gl.getParameter(gl.SAMPLES);
  +
  + gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer);
  + }
  +
  + if (samples >= MSAA_QUALITY.HIGH)
  + {
  + this.multisample = MSAA_QUALITY.HIGH;
  + }
  + else if (samples >= MSAA_QUALITY.MEDIUM)
  + {
  + this.multisample = MSAA_QUALITY.MEDIUM;
  + }
  + else if (samples >= MSAA_QUALITY.LOW)
  + {
  + this.multisample = MSAA_QUALITY.LOW;
  + }
  + else
  + {
  + this.multisample = MSAA_QUALITY.NONE;
  + }
  + }
  +
  /**
  * Add a new system to the renderer.
  * @param ClassRef - Class reference
  