wasm test: update sample index.html
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 15 Oct 2020 05:33:40 +0000 (14:33 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 19 Oct 2020 01:18:25 +0000 (10:18 +0900)
Update index.html according to updated wasm interface.
Missed chance to update index.html during review.

Change-Id: Ib2ada27619e3bee6d500f0804209dbac076be30f

test/wasm_test.html

index b383596..46e5b69 100644 (file)
@@ -1,16 +1,17 @@
 <!doctype html>
 <html>
-  <canvas id="thorvg" width="100" height="100"></canvas>
+  <canvas id="thorvg" width="320" height="320"></canvas>
   <script>
     var Module = {
       onRuntimeInitialized: function() {
 
         class SvgViewer {
           constructor() {
-             var instance = new Module.ThorvgWasm();
+             var thorvg = new Module.ThorvgWasm();
              this.canvas = document.getElementById("thorvg");
              var context = this.canvas.getContext('2d');
-             var buffer = instance.render(this.canvas.width, this.canvas.height);
+             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);