diff options
author | Simon Rettberg | 2018-07-20 18:21:41 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-07-20 18:21:41 +0200 |
commit | 7b57706df76a675592c026264d3a2028ed4b47b5 (patch) | |
tree | 3db5146b718e9cfb29e6d61461e36a3b587eb2b8 /src/client/vnc/vncwindow.h | |
parent | CMake: Add config fields for compiler flags (diff) | |
download | pvs2-7b57706df76a675592c026264d3a2028ed4b47b5.tar.gz pvs2-7b57706df76a675592c026264d3a2028ed4b47b5.tar.xz pvs2-7b57706df76a675592c026264d3a2028ed4b47b5.zip |
[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.
Diffstat (limited to 'src/client/vnc/vncwindow.h')
-rw-r--r-- | src/client/vnc/vncwindow.h | 7 |
1 files changed, 5 insertions, 2 deletions
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<QImage> _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); }; |