|
| 1 | +From 35ee8b53549fab6ebffe289417e1d94298447af7 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Shawn Rutledge < [email protected]> |
| 3 | +Date: Fri, 10 Feb 2017 13:56:58 +0100 |
| 4 | +Subject: [PATCH] fix VNC platform plugin build on big-endian machines |
| 5 | + |
| 6 | +Task-number: QTBUG-58734 |
| 7 | +Change-Id: I3e44ee4be5003acaba2f1b8ed2658a3ff1bd700e |
| 8 | +Reviewed-by: Lars Knoll < [email protected]> |
| 9 | +Reviewed-by: Dmitry Shachnev < [email protected]> |
| 10 | + |
| 11 | +Upstream: http://code.qt.io/cgit/qt/qtbase.git/patch/?id=6f64bfa654fb7e20bb75ec3b0544b81482babb44 |
| 12 | +Signed-off-by: Peter Seiderer < [email protected]> |
| 13 | +--- |
| 14 | + src/plugins/platforms/vnc/qvncclient.cpp | 6 +++--- |
| 15 | + src/plugins/platforms/vnc/qvncscreen.cpp | 7 ++++++- |
| 16 | + src/plugins/platforms/vnc/qvncscreen.h | 2 +- |
| 17 | + 3 files changed, 10 insertions(+), 5 deletions(-) |
| 18 | + |
| 19 | +diff --git a/src/plugins/platforms/vnc/qvncclient.cpp b/src/plugins/platforms/vnc/qvncclient.cpp |
| 20 | +index dae3e83f..58dcfc9b 100644 |
| 21 | +--- a/src/plugins/platforms/vnc/qvncclient.cpp |
| 22 | ++++ b/src/plugins/platforms/vnc/qvncclient.cpp |
| 23 | +@@ -142,7 +142,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const |
| 24 | + case 16: { |
| 25 | + quint16 p = *reinterpret_cast<const quint16*>(src); |
| 26 | + #if Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 27 | +- if (swapBytes) |
| 28 | ++ if (m_swapBytes) |
| 29 | + p = ((p & 0xff) << 8) | ((p & 0xff00) >> 8); |
| 30 | + #endif |
| 31 | + r = (p >> 11) & 0x1f; |
| 32 | +@@ -484,7 +484,7 @@ void QVncClient::setPixelFormat() |
| 33 | + m_sameEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian) == !!m_pixelFormat.bigEndian; |
| 34 | + m_needConversion = pixelConversionNeeded(); |
| 35 | + #if Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 36 | +- m_swapBytes = qvnc_screen->swapBytes(); |
| 37 | ++ m_swapBytes = server()->screen()->swapBytes(); |
| 38 | + #endif |
| 39 | + } |
| 40 | + } |
| 41 | +@@ -639,7 +639,7 @@ bool QVncClient::pixelConversionNeeded() const |
| 42 | + return true; |
| 43 | + |
| 44 | + #if Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 45 | +- if (qvnc_screen->swapBytes()) |
| 46 | ++ if (server()->screen()->swapBytes()) |
| 47 | + return true; |
| 48 | + #endif |
| 49 | + |
| 50 | +diff --git a/src/plugins/platforms/vnc/qvncscreen.cpp b/src/plugins/platforms/vnc/qvncscreen.cpp |
| 51 | +index 34def457..64f1bc0b 100644 |
| 52 | +--- a/src/plugins/platforms/vnc/qvncscreen.cpp |
| 53 | ++++ b/src/plugins/platforms/vnc/qvncscreen.cpp |
| 54 | +@@ -43,6 +43,7 @@ |
| 55 | + #include <QtFbSupport/private/qfbcursor_p.h> |
| 56 | + |
| 57 | + #include <QtGui/QPainter> |
| 58 | ++#include <QtGui/QScreen> |
| 59 | + #include <QtCore/QRegularExpression> |
| 60 | + |
| 61 | + |
| 62 | +@@ -172,14 +173,18 @@ QPixmap QVncScreen::grabWindow(WId wid, int x, int y, int width, int height) con |
| 63 | + } |
| 64 | + |
| 65 | + #if Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 66 | +-bool QVNCScreen::swapBytes() const |
| 67 | ++bool QVncScreen::swapBytes() const |
| 68 | + { |
| 69 | ++ return false; |
| 70 | ++ |
| 71 | ++ /* TODO |
| 72 | + if (depth() != 16) |
| 73 | + return false; |
| 74 | + |
| 75 | + if (screen()) |
| 76 | + return screen()->frameBufferLittleEndian(); |
| 77 | + return frameBufferLittleEndian(); |
| 78 | ++ */ |
| 79 | + } |
| 80 | + #endif |
| 81 | + |
| 82 | +diff --git a/src/plugins/platforms/vnc/qvncscreen.h b/src/plugins/platforms/vnc/qvncscreen.h |
| 83 | +index 785abd6d..0b42c3c7 100644 |
| 84 | +--- a/src/plugins/platforms/vnc/qvncscreen.h |
| 85 | ++++ b/src/plugins/platforms/vnc/qvncscreen.h |
| 86 | +@@ -73,7 +73,7 @@ public: |
| 87 | + void clearDirty() { dirtyRegion = QRegion(); } |
| 88 | + |
| 89 | + #if Q_BYTE_ORDER == Q_BIG_ENDIAN |
| 90 | +- bool swapBytes() const |
| 91 | ++ bool swapBytes() const; |
| 92 | + #endif |
| 93 | + |
| 94 | + QStringList mArgs; |
| 95 | +-- |
| 96 | +2.11.0 |
| 97 | + |
0 commit comments