Cache image element in the SVG renderer.

This commit is contained in:
Paul Kaplan
2018-01-17 09:42:20 -05:00
parent 89b5ed32d0
commit 8a04fcd541
2 changed files with 40 additions and 24 deletions

View File

@@ -88,7 +88,6 @@ class SVGSkin extends Skin {
});
}
/** @todo re-render a scaled version if the requested scale is significantly larger than the current render */
return this._texture;
}
@@ -103,7 +102,6 @@ class SVGSkin extends Skin {
this._svgRenderer.fromString(svgData, 1, () => {
const gl = this._renderer.gl;
this._textureScale = this._maxTextureScale = 1;
this._svgRenderer.extraScale = 1;
if (this._texture) {
gl.bindTexture(gl.TEXTURE_2D, this._texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._svgRenderer.canvas);