Tom
I don't understand why you would want to do this? SVG in browsers in probably normally hardware accelerated and if you want a rendered image you can grab the pixels easy enough, and it's fairly easy in code to add to a current svg using code. For instance with hxDaedalus js target I added optional SVG rendering which you can turn on with a compiler flag: -D svg you can try the examples by unhashing that line in the hxml's.
https://github.com/hxDaedalus/hxDaedalus-javascript-examplesIf you want scaleable you just resample the svg, I have put svg scaling into hxDaedalus
https://github.com/hxDaedalus/hxDaedalus/blob/master/src/hxDaedalus/svg/BasicSvg.hx#L57.
To convert SVG to an image, and just inject a different scale into the input data string.
public function processSVG(data: String) {
img = new Image();
img.onload = function() { drawOnScreen( data ); }
img.src = 'data:image/svg+xml;base64,' + Browser.window.btoa( data );
}
var w = img.width;
var h = img.height;
c
anvasRenderingContext2D.drawImage( img, 0, 0, w, h );
Kind of missing the point of why you want your own javascript renderer of svg when browser have really good ones?