rfb: Use the render queue for copyrect.
This will keep copyrect rendering actions in order with tight and tightPNG rendering actions (otherwise you can get visual image corruption when they are mixed together). Warning: RAW, RRE and HEXTILE still use immediate render commands so there is still the risk of out-of-order rendering if RAW, RRE, and HEXTILE are mixed with tight and tightPNG. Copyrect will work with either because the renderQ_push function will render copyrects immediately if they are the only thing being pushed on the queue.
This commit is contained in:
parent
34d8b844ae
commit
72a5596e50
|
@ -590,7 +590,9 @@ that.drawImage = function(img, x, y) {
|
|||
that.renderQ_push = function(action) {
|
||||
renderQ.push(action);
|
||||
if (renderQ.length === 1) {
|
||||
// Check if it can be rendered immediately
|
||||
// If this can be rendered immediately it will be, otherwise
|
||||
// the scanner will start polling the queue (every
|
||||
// requestAnimationFrame interval)
|
||||
scan_renderQ();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1109,9 +1109,14 @@ encHandlers.COPYRECT = function display_copy_rect() {
|
|||
var old_x, old_y;
|
||||
|
||||
if (ws.rQwait("COPYRECT", 4)) { return false; }
|
||||
old_x = ws.rQshift16();
|
||||
old_y = ws.rQshift16();
|
||||
display.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height);
|
||||
display.renderQ_push({
|
||||
'type': 'copy',
|
||||
'old_x': ws.rQshift16(),
|
||||
'old_y': ws.rQshift16(),
|
||||
'x': FBU.x,
|
||||
'y': FBU.y,
|
||||
'width': FBU.width,
|
||||
'height': FBU.height});
|
||||
FBU.rects -= 1;
|
||||
FBU.bytes = 0;
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue