瀏覽代碼

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.
Joel Martin 13 年之前
父節點
當前提交
72a5596e50
共有 2 個文件被更改,包括 11 次插入4 次删除
  1. 3 1
      include/display.js
  2. 8 3
      include/rfb.js

+ 3 - 1
include/display.js

@@ -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();
     }
 };

+ 8 - 3
include/rfb.js

@@ -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;