浏览代码

textBlobMesh leak fix

/main
xingwei.zhu 5 年前
当前提交
d5ea7d86
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 20
      Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_impl.cs

20
Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_impl.cs


}
if (clipBounds.isEmpty) {
this._drawPathDrawMeshQuit(mesh);
this._drawPathDrawMeshQuit(mesh, textMesh);
return;
}

this._drawPathDrawMeshQuit(mesh);
this._drawPathDrawMeshQuit(mesh, textMesh);
return;
}

if (maskBounds.isEmpty) {
this._drawPathDrawMeshQuit(mesh);
this._drawPathDrawMeshQuit(mesh, textMesh);
return;
}

else {
uiPaint paintWithWhite = new uiPaint(p);
paintWithWhite.color = uiColor.white;
if (EmojiUtils.image == null) return;
layer.draws.Add(CanvasShader.tex(layer, paintWithWhite, textMesh.resolveMesh(), EmojiUtils.image));
if (EmojiUtils.image == null) {
ObjectPool<TextBlobMesh>.release(textMesh);
return;
}
var raw_mesh = textMesh.resolveMesh();
var meshmesh = raw_mesh.duplicate();
ObjectPool<TextBlobMesh>.release(textMesh);
layer.draws.Add(CanvasShader.tex(layer, paintWithWhite, meshmesh, EmojiUtils.image));
void _drawPathDrawMeshQuit(uiMeshMesh mesh) {
void _drawPathDrawMeshQuit(uiMeshMesh mesh, TextBlobMesh textMesh) {
ObjectPool<TextBlobMesh>.release(textMesh);
}
void _drawPath(uiPath path, uiPaint paint) {

正在加载...
取消
保存