blob: f3f5b10dc6be9ad24a2bac1614f48c1615a70938 [file] [log] [blame]
<svg style="display: block; width: 0; height: 0">
<defs>
<filter id="blur">
<feGaussianBlur id="blurElement" stdDeviation="5 0"/>
</filter>
</defs>
</svg>
<canvas id="canvas" width="100" height="100"></canvas>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.filter = 'url(#blur)';
ctx.fillStyle = '#0f0';
ctx.fillRect(10, 20, 15, 15);
ctx.save();
ctx.fillStyle = '#00f';
ctx.fillRect(35, 20, 15, 15);
document.getElementById('blurElement').setAttribute('stdDeviation', '0, 5');
ctx.fillRect(60, 20, 15, 15);
ctx.restore();
ctx.fillRect(85, 20, 15, 15);
</script>