thorvg/test/wasm/wasm_test.html
Hermet Park bbfbe95ecc test: remove gtest & its infra.
thorvg is going to use catch2 framework, this is a cleanup work
before introducing catch2 utc.

See Catch2:
https://github.com/catchorg/Catch2/tree/v2.x
2021-06-03 17:38:07 +09:00

26 lines
840 B
HTML

<!doctype html>
<html>
<canvas id="thorvg" width="320" height="320"></canvas>
<script>
var Module = {
onRuntimeInitialized: function() {
class SvgViewer {
constructor() {
var thorvg = new Module.ThorvgWasm();
this.canvas = document.getElementById("thorvg");
var context = this.canvas.getContext('2d');
thorvg.load("", this.canvas.width, this.canvas.height);
var buffer = thorvg.render();
var clampedBuffer = Uint8ClampedArray.from(buffer);
var imageData = new ImageData(clampedBuffer, this.canvas.width, this.canvas.height);
context.putImageData(imageData, 0, 0);
}
}
var instance = new SvgViewer();
}
};
</script>
<script src="thorvg-wasm.js"></script>
</html>