mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUACAMOLE-884: Leverage createImageBitmap() for reading image data where supported.
Some browsers suffer from a memory leak when reading image data repeatedly using the Image object. Reading from Blobs does not exhibit the same behavior. While reading from Blobs has previously been seen to perform poorly compared to data URIs, this was observed when reading using createObjectURL(). The createImageBitmap() function appears to perform identically to reading data URIs using Image.
This commit is contained in:
@@ -1190,13 +1190,10 @@ Guacamole.Client = function(tunnel) {
|
||||
|
||||
// Create stream
|
||||
var stream = streams[stream_index] = new Guacamole.InputStream(guac_client, stream_index);
|
||||
var reader = new Guacamole.DataURIReader(stream, mimetype);
|
||||
|
||||
// Draw image when stream is complete
|
||||
reader.onend = function drawImageBlob() {
|
||||
display.setChannelMask(layer, channelMask);
|
||||
display.draw(layer, x, y, reader.getURI());
|
||||
};
|
||||
// Draw received contents once decoded
|
||||
display.setChannelMask(layer, channelMask);
|
||||
display.drawStream(layer, x, y, stream, mimetype);
|
||||
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user