Can't you use the `ol.dom.createCanvasContext2D` function? https://github.com/openlayers/ol3/blob/master/src/ol/dom/dom.js#L20-L29