Add ol.dom.createCanvasContext2D function