Fix blend mode and change hairline stroke width

This commit is contained in:
Patrick Walton 2019-01-10 14:19:55 -08:00
parent ffe9abba6b
commit 0da1ee7cd3
2 changed files with 4 additions and 4 deletions

View File

@ -345,13 +345,13 @@ class App {
gl.uniform1i(this.maskTileProgram.uniforms.FillColorsTexture, 1); gl.uniform1i(this.maskTileProgram.uniforms.FillColorsTexture, 1);
// FIXME(pcwalton): Maybe this should be an ivec2 or uvec2? // FIXME(pcwalton): Maybe this should be an ivec2 or uvec2?
gl.uniform2f(this.maskTileProgram.uniforms.FillColorsTextureSize, gl.uniform2f(this.maskTileProgram.uniforms.FillColorsTextureSize,
this.shaderCount, this.shaderCount,
1.0); 1.0);
gl.uniform2f(this.maskTileProgram.uniforms.ViewBoxOrigin, gl.uniform2f(this.maskTileProgram.uniforms.ViewBoxOrigin,
this.viewBox.origin.x, this.viewBox.origin.x,
this.viewBox.origin.y); this.viewBox.origin.y);
gl.blendEquation(gl.FUNC_ADD); gl.blendEquation(gl.FUNC_ADD);
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE);
gl.enable(gl.BLEND); gl.enable(gl.BLEND);
gl.drawArraysInstanced(gl.TRIANGLE_FAN, 0, 4, batch.maskTileCount); gl.drawArraysInstanced(gl.TRIANGLE_FAN, 0, 4, batch.maskTileCount);
gl.disable(gl.BLEND); gl.disable(gl.BLEND);

View File

@ -61,7 +61,7 @@ const SCALE_FACTOR: f32 = 1.0;
// TODO(pcwalton): Make this configurable. // TODO(pcwalton): Make this configurable.
const FLATTENING_TOLERANCE: f32 = 0.1; const FLATTENING_TOLERANCE: f32 = 0.1;
const HAIRLINE_STROKE_WIDTH: f32 = 0.5; const HAIRLINE_STROKE_WIDTH: f32 = 0.1;
const MAX_FILLS_PER_BATCH: usize = 0x0002_0000; const MAX_FILLS_PER_BATCH: usize = 0x0002_0000;
const MAX_MASKS_PER_BATCH: u16 = 0xffff; const MAX_MASKS_PER_BATCH: u16 = 0xffff;