diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-06-18 15:44:26 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-01 16:11:42 +0100 |
commit | b14a6bc1aacc3238a1e318d9f165d25674f34d45 (patch) | |
tree | 2ba37543fa3941d738ef73a080ae24750ac125a8 /common/rfb/CMsgReader.cxx | |
parent | 9312b0e3e16a0eee66945a1220d914067132de9a (diff) | |
download | tigervnc-b14a6bc1aacc3238a1e318d9f165d25674f34d45.tar.gz tigervnc-b14a6bc1aacc3238a1e318d9f165d25674f34d45.zip |
Split out ServerParams from ConnParams
We need to track different things in the server and client, so
separate things to two independent structures to keep things more
clear.
Diffstat (limited to 'common/rfb/CMsgReader.cxx')
-rw-r--r-- | common/rfb/CMsgReader.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx index 7502df6a..3ce74731 100644 --- a/common/rfb/CMsgReader.cxx +++ b/common/rfb/CMsgReader.cxx @@ -192,10 +192,11 @@ void CMsgReader::readFramebufferUpdate() void CMsgReader::readRect(const Rect& r, int encoding) { - if ((r.br.x > handler->cp.width()) || (r.br.y > handler->cp.height())) { + if ((r.br.x > handler->server.width()) || + (r.br.y > handler->server.height())) { fprintf(stderr, "Rect too big: %dx%d at %d,%d exceeds %dx%d\n", r.width(), r.height(), r.tl.x, r.tl.y, - handler->cp.width(), handler->cp.height()); + handler->server.width(), handler->server.height()); throw Exception("Rect too big"); } @@ -269,7 +270,7 @@ void CMsgReader::readSetCursor(int width, int height, const Point& hotspot) if (width > maxCursorSize || height > maxCursorSize) throw Exception("Too big cursor"); - int data_len = width * height * (handler->cp.pf().bpp/8); + int data_len = width * height * (handler->server.pf().bpp/8); int mask_len = ((width+7)/8) * height; rdr::U8Array data(data_len); rdr::U8Array mask(mask_len); @@ -290,14 +291,14 @@ void CMsgReader::readSetCursor(int width, int height, const Point& hotspot) int byte = y * maskBytesPerRow + x / 8; int bit = 7 - x % 8; - handler->cp.pf().rgbFromBuffer(out, in, 1); + handler->server.pf().rgbFromBuffer(out, in, 1); if (mask.buf[byte] & (1 << bit)) out[3] = 255; else out[3] = 0; - in += handler->cp.pf().bpp/8; + in += handler->server.pf().bpp/8; out += 4; } } @@ -321,10 +322,10 @@ void CMsgReader::readSetCursorWithAlpha(int width, int height, const Point& hots encoding = is->readS32(); - origPF = handler->cp.pf(); - handler->cp.setPF(rgbaPF); + origPF = handler->server.pf(); + handler->server.setPF(rgbaPF); handler->readAndDecodeRect(pb.getRect(), encoding, &pb); - handler->cp.setPF(origPF); + handler->server.setPF(origPF); // On-wire data has pre-multiplied alpha, but we store it // non-pre-multiplied |