Tryb domyślny: "source-over"
function RysujOba(operacja, transp){
ctx3.clearRect(0, 0, 200, 200);
ctx3.save()
ctx3.beginPath();
ctx3.rect(10,10, 100, 100);
ctx3.fillStyle = 'green';
ctx3.fill();
ctx3.beginPath();
ctx3.rect(120,120, 80, 40);
ctx3.fillStyle = 'blue';
ctx3.fill();
ctx3.globalCompositeOperation = operacja;
ctx3.globalAlpha = transp;
ctx3.beginPath();
ctx3.arc(100, 100, 50, 0, 2 * Math.PI, false);
ctx3.fillStyle = 'red';
ctx3.fill();
ctx3.restore();
ctx3.fillText(operacja, 10, 180);
}
WPPT, 2014/15: Grafika komputerowa i wizualizacja