Minor: you could keep the halfSize variable to avoid the division:

```js
var halfSize = radius + blur + 1;
var size = 2 * halfSize;
var context = ol.dom.createCanvasContext(size, size);
// ...
var center = halfSize - shadow;
```