xpra icon
Bug tracker and wiki

Ticket #1432: html5-scroll-tmp-canvas.patch

File html5-scroll-tmp-canvas.patch, 1.3 KB (added by Antoine Martin, 3 years ago)

use a temporary canvas to avoid overlapping blitting - does not help

  • html5/js/Window.js

     
    864864}
    865865
    866866XpraWindow.prototype.do_paint = function paint(x, y, width, height, coding, img_data, packet_sequence, rowstride, options, decode_callback) {
     867        console.log("do_paint:", coding);
    867868        if (this.debug) {
    868869                console.debug("do_paint("+img_data.length+" bytes of "+("zlib" in options?"zlib ":"")+coding+" data "+width+"x"+height+" at "+x+","+y+") focused="+this.focused);
    869870        }
     
    986987        }
    987988        else if (coding=="scroll") {
    988989                this._non_video_paint(coding);
     990                var tmp_canvas = document.createElement("canvas");
     991                var tmp_canvas_ctx = tmp_canvas.getContext('2d');
     992                this.offscreen_canvas_ctx.drawImage(tmp_canvas, 0, 0, this.w, this.h, 0, 0, this.w, this.h);
    989993                for(var i=0,j=img_data.length;i<j;++i) {
    990994                        var scroll_data = img_data[i];
    991995                        var sx = scroll_data[0],
     
    994998                                sh = scroll_data[3],
    995999                                xdelta = scroll_data[4],
    9961000                                ydelta = scroll_data[5];
    997                         this.offscreen_canvas_ctx.drawImage(this.offscreen_canvas, sx, sy, sw, sh, sx+xdelta, y+ydelta, sw, sh);
     1001                        tmp_canvas_ctx.drawImage(this.offscreen_canvas, sx, sy, sw, sh, sx+xdelta, y+ydelta, sw, sh);
    9981002                }
    9991003                painted();
    10001004        }