SPB Git forge

spb/admin-ka

Public
41commits 1branches 0releases
172.9 MBsize
maindefault branch
20 days agolast push
JavaScript 65.5% Python 17.8% CSS 13% HTML 3.7%
1.1 KB · 45 lines javascript
Raw Blame History
1/*2 * noVNC: HTML5 VNC client3 * Copyright (C) 2019 The noVNC authors4 * Licensed under MPL 2.0 (see LICENSE.txt)5 *6 * See README.md for usage and integration instructions.7 *8 */910export default class RREDecoder {11    constructor() {12        this._subrects = 0;13    }1415    decodeRect(x, y, width, height, sock, display, depth) {16        if (this._subrects === 0) {17            if (sock.rQwait("RRE", 4 + 4)) {18                return false;19            }2021            this._subrects = sock.rQshift32();2223            let color = sock.rQshiftBytes(4);  // Background24            display.fillRect(x, y, width, height, color);25        }2627        while (this._subrects > 0) {28            if (sock.rQwait("RRE", 4 + 8)) {29                return false;30            }3132            let color = sock.rQshiftBytes(4);33            let sx = sock.rQshift16();34            let sy = sock.rQshift16();35            let swidth = sock.rQshift16();36            let sheight = sock.rQshift16();37            display.fillRect(x + sx, y + sy, swidth, sheight, color);3839            this._subrects--;40        }4142        return true;43    }44}45