void-packages/srcpkgs/qt5/patches/mipseb-fix.patch

67 lines
2.1 KiB
Diff

--- qtbase/src/plugins/platforms/vnc/qvncclient.cpp 2017-01-18 15:20:58.000000000 +0100
+++ qtbase/src/plugins/platforms/vnc/qvncclient.cpp 2017-12-12 18:56:14.884248330 +0100
@@ -142,8 +142,8 @@
case 16: {
quint16 p = *reinterpret_cast<const quint16*>(src);
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- if (swapBytes)
- p = ((p & 0xff) << 8) | ((p & 0xff00) >> 8);
+ if (m_swapBytes)
+ p = (p << 8) | (p >> 8);
#endif
r = (p >> 11) & 0x1f;
g = (p >> 5) & 0x3f;
@@ -484,7 +484,7 @@
m_sameEndian = (QSysInfo::ByteOrder == QSysInfo::BigEndian) == !!m_pixelFormat.bigEndian;
m_needConversion = pixelConversionNeeded();
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- m_swapBytes = qvnc_screen->swapBytes();
+ m_swapBytes = m_server->screen()->swapBytes();
#endif
}
}
@@ -639,7 +639,7 @@
return true;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- if (qvnc_screen->swapBytes())
+ if (m_server->screen()->swapBytes())
return true;
#endif
--- qtbase/src/plugins/platforms/vnc/qvncscreen.cpp 2017-01-18 15:20:58.000000000 +0100
+++ qtbase/src/plugins/platforms/vnc/qvncscreen.cpp 2017-12-12 18:42:41.609190327 +0100
@@ -172,14 +172,16 @@
}
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-bool QVNCScreen::swapBytes() const
+bool QVncScreen::swapBytes() const
{
if (depth() != 16)
return false;
-
- if (screen())
- return screen()->frameBufferLittleEndian();
- return frameBufferLittleEndian();
+ for (int y = 0; y < mScreenImage->height(); y++) {
+ quint16* p = reinterpret_cast<quint16*>(mScreenImage->scanLine(y));
+ for (int x = 0; x < mScreenImage->width(); x++, p++)
+ *p = (*p >> 8) | (*p << 8);
+ }
+ return true;
}
#endif
--- qtbase/src/plugins/platforms/vnc/qvncscreen.h 2017-01-18 15:20:58.000000000 +0100
+++ qtbase/src/plugins/platforms/vnc/qvncscreen.h 2017-12-12 17:38:29.003915557 +0100
@@ -73,7 +73,7 @@
void clearDirty() { dirtyRegion = QRegion(); }
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- bool swapBytes() const
+ bool swapBytes() const;
#endif
QStringList mArgs;