bug描述:
目前debug估计是blend的时候src color正常,dst color总是为(0,0,0,0)
- 当前 Bug 的表现(可附上截图)
在小米8上,出现异常
- 预期表现
在honor v20上,正常显示
关键代码:
_render = () => {
const { gl } = this._glRenderer;
gl.viewport(0, 0, this._width, this._height);
const fb = gl.createFramebuffer();
const rb = gl.createRenderbuffer();
const texture = gl.createTexture();
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(
gl.TEXTURE_2D,
0,
gl.RGBA,
this._width,
this._height,
0,
gl.RGBA,
gl.UNSIGNED_BYTE,
null
);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.framebufferTexture2D(
gl.FRAMEBUFFER,
gl.COLOR_ATTACHMENT0,
gl.TEXTURE_2D,
texture,
0
);
gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
gl.renderbufferStorage(
gl.RENDERBUFFER,
gl.DEPTH_COMPONENT16,
this._width,
this._height
);
gl.framebufferRenderbuffer(
gl.FRAMEBUFFER,
gl.DEPTH_ATTACHMENT,
gl.RENDERBUFFER,
rb
);
this._drawContent(gl);
gl.deleteRenderbuffer(rb);
gl.deleteFramebuffer(fb);
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
const { _drawPath: drawPath } = this;
drawPath.lassoTex.destroy(gl);
drawPath.lassoTex.texture = texture;
drawPath.lassoTex.scale = this._scale;
drawPath.lassoTex.drawing = false;
this._glRenderer.requestRender();
};