Push image to the render queue when it is loaded

This commit is contained in:
Adam Babik 2015-12-02 09:28:19 -08:00
parent b2a813dc73
commit 3141352d43
1 changed files with 9 additions and 7 deletions

View File

@ -1958,14 +1958,16 @@ var RFB;
// We have everything, render it // We have everything, render it
this._sock.rQskipBytes(1 + cl_header); // shift off clt + compact length this._sock.rQskipBytes(1 + cl_header); // shift off clt + compact length
var img = new Image(); var img = new Image();
img.src = "data: image/" + cmode + img.onload = function (img, x, y) {
RFB.extract_data_uri(this._sock.rQshiftBytes(cl_data));
this._display.renderQ_push({ this._display.renderQ_push({
'type': 'img', 'type': 'img',
'img': img, 'img': img,
'x': this._FBU.x, 'x': x,
'y': this._FBU.y 'y': y
}); });
}.bind(this, img, this._FBU.x, this._FBU.y);
img.src = "data:image/" + cmode +
RFB.extract_data_uri(this._sock.rQshiftBytes(cl_data));
img = null; img = null;
break; break;
case "filter": case "filter":