From 7b57706df76a675592c026264d3a2028ed4b47b5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 20 Jul 2018 18:21:41 +0200 Subject: [client] Rewrite thread sync for VNC yet again Move processing of image (scaling) to GUI thread. Get rid of second (scaled) image buffer. Instead, whenever we redraw parts of the VNC viewer, the according image parts will be copied and scaled from the buffer the vncclient thread is using. The buffer is wrapped in a QImage and handed over using a QSharedPointer, so reinitializing the buffer on the fly should yield no problems. --- src/client/vnc/vncwindow.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/vnc/vncwindow.h') diff --git a/src/client/vnc/vncwindow.h b/src/client/vnc/vncwindow.h index cdcf51f..7124ddc 100644 --- a/src/client/vnc/vncwindow.h +++ b/src/client/vnc/vncwindow.h @@ -44,12 +44,13 @@ signals: protected: void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent* event); + void resizeEvent(QResizeEvent*) { this->update(); } void closeEvent(QCloseEvent *e); void timerEvent(QTimerEvent *event); void keyReleaseEvent(QKeyEvent *event); private: + int _srcStepX, _srcStepY, _dstStepX, _dstStepY; VncThread *_vncWorker; bool _viewOnly; bool _multiScreen; @@ -57,10 +58,12 @@ private: int _redrawTimer; int _tcpTimeoutTimer; QPixmap _remoteThumb; - QSharedPointer _image; + QSize _remoteSize; + QSize _desiredSize; void draw(const int x, const int y, const int w, const int h); void terminateVncThread(); + bool calcScaling(const QImage *remote); }; -- cgit v1.2.3-55-g7522