rewrite quic.js to be a native javascript implementation
There remain a few TODOs including implementing more than just rgb32 images Signed-off-by: Aric Stewart <aric@codeweavers.com>
This commit is contained in:
parent
7ebc4d019a
commit
b4ab3ac5e9
8
TODO
8
TODO
@ -28,9 +28,6 @@ Medium Tasks:
|
|||||||
|
|
||||||
. Use the 'real' DataView if we have it
|
. Use the 'real' DataView if we have it
|
||||||
|
|
||||||
. Remove main() from quic.c and respin it
|
|
||||||
- It's causing unneeded bloat and memory use.
|
|
||||||
|
|
||||||
. Consider passing a status change event back to the front end
|
. Consider passing a status change event back to the front end
|
||||||
(e.g. indicators for numlock, connection status, all that jazz)
|
(e.g. indicators for numlock, connection status, all that jazz)
|
||||||
|
|
||||||
@ -71,11 +68,6 @@ Big Tasks:
|
|||||||
. Profile the whole mess
|
. Profile the whole mess
|
||||||
- Initial profiling suggests image decompression is the big hog
|
- Initial profiling suggests image decompression is the big hog
|
||||||
|
|
||||||
. Quic: faster implementations
|
|
||||||
* current implementation is approximately 13x slower
|
|
||||||
than equivalent C code. Should be able to do
|
|
||||||
much better than that.
|
|
||||||
|
|
||||||
. Implement agent support
|
. Implement agent support
|
||||||
|
|
||||||
. Build a test suite for measuring performance
|
. Build a test suite for measuring performance
|
||||||
|
@ -50,9 +50,6 @@ function stripAlpha(d)
|
|||||||
d.data[i + 3] = 255;
|
d.data[i + 3] = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME - this is a hack for quic.js, I should fix this...
|
|
||||||
var global_ctx;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------
|
/*----------------------------------------------------------------------------
|
||||||
** SpiceDisplayConn
|
** SpiceDisplayConn
|
||||||
** Drive the Spice Display Channel
|
** Drive the Spice Display Channel
|
||||||
@ -108,16 +105,19 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
|
|||||||
|
|
||||||
if (draw_copy.data.src_bitmap.descriptor.type == SPICE_IMAGE_TYPE_QUIC)
|
if (draw_copy.data.src_bitmap.descriptor.type == SPICE_IMAGE_TYPE_QUIC)
|
||||||
{
|
{
|
||||||
|
var canvas = this.surfaces[draw_copy.base.surface_id].canvas;
|
||||||
if (! draw_copy.data.src_bitmap.quic)
|
if (! draw_copy.data.src_bitmap.quic)
|
||||||
{
|
{
|
||||||
this.log_warn("FIXME: DrawCopy could not handle this QUIC file.");
|
this.log_warn("FIXME: DrawCopy could not handle this QUIC file.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
var source_img = convert_spice_quic_to_web(canvas.context,
|
||||||
|
draw_copy.data.src_bitmap.quic);
|
||||||
|
|
||||||
return this.draw_copy_helper(
|
return this.draw_copy_helper(
|
||||||
{ base: draw_copy.base,
|
{ base: draw_copy.base,
|
||||||
src_area: draw_copy.data.src_area,
|
src_area: draw_copy.data.src_area,
|
||||||
image_data: draw_copy.data.src_bitmap.quic.imgData,
|
image_data: source_img,
|
||||||
tag: "copyquic." + draw_copy.data.src_bitmap.quic.type,
|
tag: "copyquic." + draw_copy.data.src_bitmap.quic.type,
|
||||||
has_alpha: (draw_copy.data.src_bitmap.quic.type == QUIC_IMAGE_TYPE_RGBA ? true : false) ,
|
has_alpha: (draw_copy.data.src_bitmap.quic.type == QUIC_IMAGE_TYPE_RGBA ? true : false) ,
|
||||||
descriptor : draw_copy.data.src_bitmap.descriptor
|
descriptor : draw_copy.data.src_bitmap.descriptor
|
||||||
@ -404,7 +404,6 @@ SpiceDisplayConn.prototype.process_channel_message = function(msg)
|
|||||||
|
|
||||||
/* This .save() is done entirely to enable SPICE_MSG_DISPLAY_RESET */
|
/* This .save() is done entirely to enable SPICE_MSG_DISPLAY_RESET */
|
||||||
canvas.context.save();
|
canvas.context.save();
|
||||||
global_ctx = canvas.context; // FIXME - this is a hack entirely for the emscripten quic.js
|
|
||||||
document.getElementById(this.parent.screen_id).appendChild(canvas);
|
document.getElementById(this.parent.screen_id).appendChild(canvas);
|
||||||
document.getElementById(this.parent.screen_id).setAttribute('width', m.surface.width);
|
document.getElementById(this.parent.screen_id).setAttribute('width', m.surface.width);
|
||||||
document.getElementById(this.parent.screen_id).setAttribute('height', m.surface.height);
|
document.getElementById(this.parent.screen_id).setAttribute('height', m.surface.height);
|
||||||
|
8
makequic
8
makequic
@ -1,8 +0,0 @@
|
|||||||
./emcc -o quic.js --shell-file quic.shell quic.c
|
|
||||||
echo Okay, quic.js is partly ready. Three things to do:
|
|
||||||
echo 1. In function _quic_decode_js, after the call to simple_quic_decode,
|
|
||||||
echo add the code as given by quic.shell
|
|
||||||
echo 2. Delete the run() 3 line block near the bottom.
|
|
||||||
echo 3. Add the getQuic() function to the bottom (see quic.shell)
|
|
||||||
|
|
||||||
|
|
91
quic.shell
91
quic.shell
File diff suppressed because one or more lines are too long
10
spicetype.js
10
spicetype.js
@ -236,14 +236,8 @@ SpiceImage.prototype =
|
|||||||
|
|
||||||
if (this.descriptor.type == SPICE_IMAGE_TYPE_QUIC)
|
if (this.descriptor.type == SPICE_IMAGE_TYPE_QUIC)
|
||||||
{
|
{
|
||||||
var tmparr = [];
|
this.quic = new SpiceQuic;
|
||||||
var i;
|
at = this.quic.from_dv(dv, at, mb);
|
||||||
this.quicr_length = dv.getUint32(at, true); at += 4;
|
|
||||||
var qdv = new Uint8Array(mb.slice(at));
|
|
||||||
for (i = 0; i < qdv.length; i++)
|
|
||||||
tmparr[i] = qdv[i];
|
|
||||||
this.quic = getQuic(tmparr);
|
|
||||||
at += qdv.length;
|
|
||||||
}
|
}
|
||||||
return at;
|
return at;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user