Merge ed6ce1cfd2 into c42ea22525
This commit is contained in:
commit
056706f5a9
|
|
@ -1491,14 +1491,9 @@ var RFB;
|
||||||
// We know the encoding and have a whole tile
|
// We know the encoding and have a whole tile
|
||||||
this._FBU.subencoding = rQ[rQi];
|
this._FBU.subencoding = rQ[rQi];
|
||||||
rQi++;
|
rQi++;
|
||||||
if (this._FBU.subencoding === 0) {
|
if ((this._FBU.subencoding === 0) && (this._FBU.lastsubencoding & 0x01)) {
|
||||||
if (this._FBU.lastsubencoding & 0x01) {
|
|
||||||
// Weird: ignore blanks are RAW
|
// Weird: ignore blanks are RAW
|
||||||
Util.Debug(" Ignoring blank after RAW");
|
Util.Debug(" Ignoring blank after RAW");
|
||||||
} else {
|
|
||||||
this._display.fillRect(x, y, w, h, rQ, rQi);
|
|
||||||
rQi += this._FBU.bytes - 1;
|
|
||||||
}
|
|
||||||
} else if (this._FBU.subencoding & 0x01) { // Raw
|
} else if (this._FBU.subencoding & 0x01) { // Raw
|
||||||
this._display.blitImage(x, y, w, h, rQ, rQi);
|
this._display.blitImage(x, y, w, h, rQ, rQi);
|
||||||
rQi += this._FBU.bytes - 1;
|
rQi += this._FBU.bytes - 1;
|
||||||
|
|
|
||||||
|
|
@ -1312,6 +1312,21 @@ describe('Remote Frame Buffer Protocol Client', function() {
|
||||||
expect(client._display).to.have.displayed(new Uint8Array(expected));
|
expect(client._display).to.have.displayed(new Uint8Array(expected));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle a tile with only bg specified and an empty frame afterwards', function () {
|
||||||
|
var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }];
|
||||||
|
var rect = [];
|
||||||
|
rect.push(0x02);
|
||||||
|
rect.push32(0xff00ff); // becomes 00ff00ff --> #00FF00 bg color
|
||||||
|
send_fbu_msg(info, [rect], client);
|
||||||
|
rect.push(0x00);
|
||||||
|
send_fbu_msg(info, [rect], client);
|
||||||
|
|
||||||
|
var expected = [];
|
||||||
|
for (var i = 0; i < 16; i++) { expected.push32(0xff00ff); } // rect 1: solid
|
||||||
|
for (var i = 16; i < 32; i++) { expected.push32(0xff00ff); } // rect 2: same bkground color
|
||||||
|
expect(client._display).to.have.displayed(new Uint8Array(expected));
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle a tile with bg and coloured subrects', function () {
|
it('should handle a tile with bg and coloured subrects', function () {
|
||||||
var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }];
|
var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }];
|
||||||
var rect = [];
|
var rect = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue