Canvas 的绘制层级问题

请教引擎大佬,我在用原生的canvas实现一些小功能
用了原生的canvas API,但是这个属性我一直不明白 ctx.globalCompositeOperation = “destination-in”;
这个效果,我用来做裁剪,我的代码是:


但是最后的效果是:

我通过ctx.save() 保存了上下文状态,为什么下方还是受了影响,
按照我的理解,这两个CANVAS 都应该绘制出来的,互不影响

我把代码贴在这里
function drawLogo() {

ctx.save();

ctx.beginPath();

ctx.fillStyle = "#fff"

ctx.font = "60px 微软雅黑";

ctx.textAlign = 'center';

ctx.textBaseline = "middle";

ctx.fillText("CANVAS", width / 2, height / 2);

ctx.globalCompositeOperation = "destination-in";

ctx.arc(width / 2, height / 2, 150, 0, Math.PI * 2, true);

ctx.closePath();

ctx.fill();

ctx.restore();

ctx.save();

ctx.beginPath();

ctx.fillStyle = "#fff"

ctx.font = "60px 微软雅黑";

ctx.textAlign = 'center';

ctx.textBaseline = "middle";

ctx.fillText("CANVAS", width / 2 + 150, height / 2 + 150);

ctx.globalCompositeOperation = "destination-in";

ctx.arc(width / 2 + 150, height / 2 + 150, 150, 0, Math.PI * 2, true);

ctx.closePath();

ctx.fill();

ctx.restore();

}

你把两个圆写在一起就行了,别分开写

你这样操作是对整个画布进行裁剪了,为什么不用clip啊。非用这个就把要渲染的部分都放在前面操作,最后在绘制裁剪图形。