don't erase the surface before blitting.

It's done at HTML level with canvas.clearRect()

BUG=webp:261

Change-Id: I83c73791f5922cd1f426f19faf856fa1cf8f0311
This commit is contained in:
Pascal Massimino
2017-02-08 16:34:57 +01:00
parent 4105d565d3
commit 027151ca6c
2 changed files with 7 additions and 4 deletions

View File

@ -21,8 +21,11 @@ function init() {
function decode(webp_data, canvas_id) {
// get the canvas to decode into
Module.canvas = document.getElementById(canvas_id);
if (Module.canvas == null) return;
var canvas = document.getElementById(canvas_id);
if (canvas == null) return;
// clear previous picture (if any)
Module.canvas = canvas;
canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);
// decode and measure timing
start = new Date();
var ret = WebpToCanvas(webp_data, webp_data.length);