Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13

Liang Qi 2019-05-13 11:54:03 +00:00 committed by The Qt Project
commit ffdcad9e40
22 changed files with 198 additions and 41 deletions

View File

@ -69,11 +69,11 @@ int main(int argc, char *argv[])
QSurfaceFormat fmt;
fmt.setDepthBufferSize(24);
// Request OpenGL 3.3 compatibility or OpenGL ES 3.0.
// Request OpenGL 3.3 core or OpenGL ES 3.0.
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
qDebug("Requesting 3.3 compatibility context");
qDebug("Requesting 3.3 core context");
fmt.setVersion(3, 3);
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
fmt.setProfile(QSurfaceFormat::CoreProfile);
} else {
qDebug("Requesting 3.0 context");
fmt.setVersion(3, 0);

View File

@ -211,10 +211,10 @@ CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
mac {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.prl
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
} else {
qt_framework {
@ -222,7 +222,7 @@ mac {
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
CMAKE_BUILD_IS_FRAMEWORK = "true"
} else {
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.$$eval(QT.$${MODULE}.VERSION).dylib
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
}
}

View File

@ -49,6 +49,7 @@ on big endian machines, or a byte-by-byte read if the endianess is unknown.
#include "PMurHash.h"
#include <stdint.h>
/* I used ugly type names in the header to avoid potential conflicts with
* application or system typedefs & defines. Since I'm not including any more
@ -208,7 +209,7 @@ void PMurHash32_Process(uint32_t *ph1, uint32_t *pcarry, const void *key, int le
/* This CPU does not handle unaligned word access */
/* Consume enough so that the next data byte is word aligned */
int i = -(long)ptr & 3;
int i = -(intptr_t)ptr & 3;
if(i && i <= len) {
DOBYTES(i, h1, c, n, ptr, len);
}

View File

@ -41,6 +41,7 @@ package org.qtproject.qt5.android;
import android.content.Context;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
@ -73,7 +74,7 @@ public class EditContextView extends LinearLayout implements View.OnClickListene
m_buttonId = stringId;
setText(stringId);
setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
ViewGroup.LayoutParams.WRAP_CONTENT, 1));
setGravity(Gravity.CENTER);
setTextColor(getResources().getColor(R.color.widget_edittext_dark));
EditContextView.this.setBackground(getResources().getDrawable(R.drawable.editbox_background_normal));
@ -81,6 +82,8 @@ public class EditContextView extends LinearLayout implements View.OnClickListene
int hPadding = (int)(16 * scale + 0.5f);
int vPadding = (int)(8 * scale + 0.5f);
setPadding(hPadding, vPadding, hPadding, vPadding);
setSingleLine();
setEllipsize(TextUtils.TruncateAt.END);
setOnClickListener(EditContextView.this);
}
}

View File

@ -0,0 +1,35 @@
From e7ff4aa4ef2221aa02d39bdead7f35008016994e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Fri, 26 Apr 2019 14:57:01 +0300
Subject: [PATCH] ANGLE: Backport fix for compilation on mingw/64bit with clang
This backports the following upstream fix from angle:
https://github.com/google/angle/commit/63cc351fbad06c6241d1c7372fe76f74e1d09a10
---
.../angle/src/common/third_party/smhasher/src/PMurHash.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/angle/src/common/third_party/smhasher/src/PMurHash.cpp b/src/3rdparty/angle/src/common/third_party/smhasher/src/PMurHash.cpp
index 071bc31539..93b48713cd 100644
--- a/src/3rdparty/angle/src/common/third_party/smhasher/src/PMurHash.cpp
+++ b/src/3rdparty/angle/src/common/third_party/smhasher/src/PMurHash.cpp
@@ -49,6 +49,7 @@ on big endian machines, or a byte-by-byte read if the endianess is unknown.
#include "PMurHash.h"
+#include <stdint.h>
/* I used ugly type names in the header to avoid potential conflicts with
* application or system typedefs & defines. Since I'm not including any more
@@ -208,7 +209,7 @@ void PMurHash32_Process(uint32_t *ph1, uint32_t *pcarry, const void *key, int le
/* This CPU does not handle unaligned word access */
/* Consume enough so that the next data byte is word aligned */
- int i = -(long)ptr & 3;
+ int i = -(intptr_t)ptr & 3;
if(i && i <= len) {
DOBYTES(i, h1, c, n, ptr, len);
}
--
2.20.1 (Apple Git-117)

View File

@ -64,6 +64,19 @@ QT_BEGIN_NAMESPACE
\since 5.9
*/
/*!
\macro QT_NO_FLOAT16_OPERATORS
\relates <QFloat16>
\since 5.12.4
Defining this macro disables the arithmetic operators for qfloat16.
This is only necessary on Visual Studio 2017 (and earlier) when including
\c {<QFloat16>} and \c{<bitset>} in the same translation unit, which would
otherwise cause a compilation error due to a toolchain bug (see
[QTBUG-72073]).
*/
/*!
Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
\relates <QFloat16>

View File

@ -81,7 +81,9 @@ private:
Q_CORE_EXPORT static const quint32 shifttable[];
friend bool qIsNull(qfloat16 f) Q_DECL_NOTHROW;
#if !defined(QT_NO_FLOAT16_OPERATORS)
friend qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW;
#endif
};
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
@ -163,6 +165,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
}
#endif
#if !defined(QT_NO_FLOAT16_OPERATORS)
inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
{
qfloat16 f;
@ -244,6 +247,7 @@ QF16_MAKE_BOOL_OP_INT(!=)
#undef QF16_MAKE_BOOL_OP_INT
QT_WARNING_POP
#endif // QT_NO_FLOAT16_OPERATORS
/*!
\internal

View File

@ -65,14 +65,19 @@
\section1 Thread-Safety
QSharedPointer and QWeakPointer are thread-safe and operate
atomically on the pointer value. Different threads can also access
the QSharedPointer or QWeakPointer pointing to the same object at
the same time without need for locking mechanisms.
QSharedPointer and QWeakPointer are reentrant classes. This means that, in
general, a given QSharedPointer or QWeakPointer object \b{cannot} be
accessed by multiple threads at the same time without synchronization.
It should be noted that, while the pointer value can be accessed
in this manner, QSharedPointer and QWeakPointer provide no
guarantee about the object being pointed to. Thread-safety and
Different QSharedPointer and QWeakPointer objects can safely be accessed
by multiple threads at the same time. This includes the case where they
hold pointers to the same object; the reference counting mechanism
is atomic, and no manual synchronization is required.
It should be noted that, while the pointer value can be accessed in this
manner (that is, by multiple threads at the same time, without
synchronization), QSharedPointer and QWeakPointer provide no guarantee
about the object being pointed to. The specific thread-safety and
reentrancy rules for that object still apply.
\section1 Other Pointer Classes

View File

@ -29,7 +29,7 @@
world's languages, with the largest and most extensive standard repository of locale data
available.",
"Homepage": "http://cldr.unicode.org/",
"Version": "v34",
"Version": "v35.1",
"License": "// as specified in https://spdx.org/licenses/Unicode-DFS-2016.html",
"License": "Unicode License Agreement - Data Files and Software (2016)",
"LicenseId": "Unicode-DFS-2016",

View File

@ -156,6 +156,17 @@ template<bool RGBA, bool RGBx>
static inline void convertARGBFromARGB32PM_sse4(uint *buffer, const uint *src, int count)
{
int i = 0;
if ((_MM_GET_EXCEPTION_MASK() & _MM_MASK_INVALID) == 0) {
for (; i < count; ++i) {
uint v = qUnpremultiply(src[i]);
if (RGBx)
v = 0xff000000 | v;
if (RGBA)
v = ARGB2RGBA(v);
buffer[i] = v;
}
return;
}
const __m128i alphaMask = _mm_set1_epi32(0xff000000);
const __m128i rgbaMask = _mm_setr_epi8(2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15);
const __m128i zero = _mm_setzero_si128();
@ -223,6 +234,13 @@ template<bool RGBA>
static inline void convertARGBFromRGBA64PM_sse4(uint *buffer, const QRgba64 *src, int count)
{
int i = 0;
if ((_MM_GET_EXCEPTION_MASK() & _MM_MASK_INVALID) == 0) {
for (; i < count; ++i) {
const QRgba64 v = src[i].unpremultiplied();
buffer[i] = RGBA ? toRgba8888(v) : toArgb32(v);
}
return;
}
const __m128i alphaMask = _mm_set1_epi64x(qint64(Q_UINT64_C(0xffff) << 48));
const __m128i alphaMask32 = _mm_set1_epi32(0xff000000);
const __m128i rgbaMask = _mm_setr_epi8(2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15);

View File

@ -6,7 +6,7 @@ CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
HEADERS +=
HEADERS += \
qkmsdevice_p.h
SOURCES += \

View File

@ -791,7 +791,7 @@ void QAndroidInputContext::longPress(int x, int y)
return;
}
QList<QInputMethodEvent::Attribute> imAttributes;
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursor, 0, QVariant()));
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, anchor, cursor - anchor, QVariant()));
QInputMethodEvent event(QString(), imAttributes);
QGuiApplication::sendEvent(m_focusObject, &event);

View File

@ -81,6 +81,7 @@ public:
QPlatformTextureList *textures, bool translucentBackground) override;
#endif
QImage toImage() const override;
QPlatformGraphicsBuffer *graphicsBuffer() const override;
private:

View File

@ -522,6 +522,21 @@ void QCALayerBackingStore::composeAndFlush(QWindow *window, const QRegion &regio
}
#endif
QImage QCALayerBackingStore::toImage() const
{
if (!const_cast<QCALayerBackingStore*>(this)->prepareForFlush())
return QImage();
// We need to make a copy here, as the returned image could be used just
// for reading, in which case it won't detach, and then the underlying
// image data might change under the feet of the client when we re-use
// the buffer at a later point.
m_buffers.back()->lock(QPlatformGraphicsBuffer::SWReadAccess);
QImage imageCopy = m_buffers.back()->asImage()->copy();
m_buffers.back()->unlock();
return imageCopy;
}
QPlatformGraphicsBuffer *QCALayerBackingStore::graphicsBuffer() const
{
return m_buffers.back().get();

View File

@ -1086,9 +1086,11 @@ void QCocoaWindow::setEmbeddedInForeignView()
void QCocoaWindow::viewDidChangeFrame()
{
if (isContentView())
return; // Handled below
// Note: When the view is the content view, it would seem redundant
// to deliver geometry changes both from windowDidResize and this
// callback, but in some cases such as when macOS native tabbed
// windows are enabled we may end up with the wrong geometry in
// the initial windowDidResize callback when a new tab is created.
handleGeometryChange();
}

View File

@ -1325,6 +1325,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return false;
platformWindow->setFlag(QWindowsWindow::WithinDpiChanged);
const RECT *prcNewWindow = reinterpret_cast<RECT *>(lParam);
qCDebug(lcQpaWindows) << __FUNCTION__ << "WM_DPICHANGED"
<< platformWindow->window() << *prcNewWindow;
SetWindowPos(hwnd, nullptr, prcNewWindow->left, prcNewWindow->top,
prcNewWindow->right - prcNewWindow->left,
prcNewWindow->bottom - prcNewWindow->top, SWP_NOZORDER | SWP_NOACTIVATE);

View File

@ -240,7 +240,8 @@ QWindow *QWindowsScreen::topLevelAt(const QPoint &point) const
QWindow *result = nullptr;
if (QWindow *child = QWindowsScreen::windowAt(point, CWP_SKIPINVISIBLE))
result = QWindowsWindow::topLevelOf(child);
qCDebug(lcQpaWindows) <<__FUNCTION__ << point << result;
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaWindows) <<__FUNCTION__ << point << result;
return result;
}
@ -250,7 +251,8 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags)
if (QPlatformWindow *bw = QWindowsContext::instance()->
findPlatformWindowAt(GetDesktopWindow(), screenPoint, flags))
result = bw->window();
qCDebug(lcQpaWindows) <<__FUNCTION__ << screenPoint << " returns " << result;
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaWindows) <<__FUNCTION__ << screenPoint << " returns " << result;
return result;
}

View File

@ -184,6 +184,7 @@ static inline RECT RECTfromQRect(const QRect &rect)
return result;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug d, const RECT &r)
{
@ -262,6 +263,16 @@ QDebug operator<<(QDebug d, const GUID &guid)
}
#endif // !QT_NO_DEBUG_STREAM
static void formatBriefRectangle(QDebug &d, const QRect &r)
{
d << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign;
}
static void formatBriefMargins(QDebug &d, const QMargins &m)
{
d << m.left() << ", " << m.top() << ", " << m.right() << ", " << m.bottom();
}
// QTBUG-43872, for windows that do not have WS_EX_TOOLWINDOW set, WINDOWPLACEMENT
// is in workspace/available area coordinates.
static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
@ -1676,6 +1687,51 @@ QRect QWindowsWindow::normalGeometry() const
return frame.isValid() ? frame.marginsRemoved(margins) : frame;
}
static QString msgUnableToSetGeometry(const QWindowsWindow *platformWindow,
const QRect &requestedRect,
const QRect &obtainedRect,
const QMargins &fullMargins,
const QMargins &customMargins)
{
QString result;
QDebug debug(&result);
debug.nospace();
debug.noquote();
const auto window = platformWindow->window();
debug << "Unable to set geometry ";
formatBriefRectangle(debug, requestedRect);
debug << " (frame: ";
formatBriefRectangle(debug, requestedRect + fullMargins);
debug << ") on " << window->metaObject()->className() << "/\""
<< window->objectName() << "\" on \"" << window->screen()->name()
<< "\". Resulting geometry: ";
formatBriefRectangle(debug, obtainedRect);
debug << " (frame: ";
formatBriefRectangle(debug, obtainedRect + fullMargins);
debug << ") margins: ";
formatBriefMargins(debug, fullMargins);
if (!customMargins.isNull()) {
debug << " custom margin: ";
formatBriefMargins(debug, customMargins);
}
const auto minimumSize = window->minimumSize();
const bool hasMinimumSize = !minimumSize.isEmpty();
if (hasMinimumSize)
debug << " minimum size: " << minimumSize.width() << 'x' << minimumSize.height();
const auto maximumSize = window->maximumSize();
const bool hasMaximumSize = maximumSize.width() != QWINDOWSIZE_MAX || maximumSize.height() != QWINDOWSIZE_MAX;
if (hasMaximumSize)
debug << " maximum size: " << maximumSize.width() << 'x' << maximumSize.height();
if (hasMinimumSize || hasMaximumSize) {
MINMAXINFO minmaxInfo;
memset(&minmaxInfo, 0, sizeof(minmaxInfo));
platformWindow->getSizeHints(&minmaxInfo);
debug << ' ' << minmaxInfo;
}
debug << ')';
return result;
}
void QWindowsWindow::setGeometry(const QRect &rectIn)
{
QRect rect = rectIn;
@ -1695,21 +1751,10 @@ void QWindowsWindow::setGeometry(const QRect &rectIn)
setGeometry_sys(rect);
clearFlag(WithinSetGeometry);
if (m_data.geometry != rect && (isVisible() || QLibraryInfo::isDebugBuild())) {
qWarning("%s: Unable to set geometry %dx%d+%d+%d on %s/'%s'."
" Resulting geometry: %dx%d+%d+%d "
"(frame: %d, %d, %d, %d, custom margin: %d, %d, %d, %d"
", minimum size: %dx%d, maximum size: %dx%d).",
__FUNCTION__,
rect.width(), rect.height(), rect.x(), rect.y(),
window()->metaObject()->className(), qPrintable(window()->objectName()),
m_data.geometry.width(), m_data.geometry.height(),
m_data.geometry.x(), m_data.geometry.y(),
m_data.fullFrameMargins.left(), m_data.fullFrameMargins.top(),
m_data.fullFrameMargins.right(), m_data.fullFrameMargins.bottom(),
m_data.customMargins.left(), m_data.customMargins.top(),
m_data.customMargins.right(), m_data.customMargins.bottom(),
window()->minimumWidth(), window()->minimumHeight(),
window()->maximumWidth(), window()->maximumHeight());
const auto warning =
msgUnableToSetGeometry(this, rectIn, m_data.geometry,
m_data.fullFrameMargins, m_data.customMargins);
qWarning("%s: %s", __FUNCTION__, qPrintable(warning));
}
} else {
QPlatformWindow::setGeometry(rect);

View File

@ -4290,12 +4290,15 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
alpha:pc.alphaF()];
s = qt_mac_removeMnemonics(s);
const auto textRect = CGRectMake(xpos, yPos, mi->rect.width() - xm - tabwidth + 1, mi->rect.height());
QMacCGContext cgCtx(p);
d->setupNSGraphicsContext(cgCtx, YES);
[s.toNSString() drawInRect:textRect
// Draw at point instead of in rect, as the rect we've computed for the menu item
// is based on the font metrics we got from HarfBuzz, so we may risk having CoreText
// line-break the string if it doesn't fit the given rect. It's better to draw outside
// the rect and possibly overlap something than to have part of the text disappear.
[s.toNSString() drawAtPoint:CGPointMake(xpos, yPos)
withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c,
NSObliquenessAttributeName: [NSNumber numberWithDouble: myFont.italic() ? 0.3 : 0.0]}];

View File

@ -241,7 +241,8 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
if (!*data || *data != '.') {
token = INTEGER_LITERAL;
if (data - lexem == 1 &&
(*data == 'x' || *data == 'X')
(*data == 'x' || *data == 'X'
|| *data == 'b' || *data == 'B')
&& *lexem == '0') {
++data;
while (is_hex_char(*data) || *data == '\'')

View File

@ -9367,6 +9367,12 @@ bool QWidget::event(QEvent *event)
d->renderToTextureReallyDirty = 1;
#endif
break;
case QEvent::PlatformSurface: {
auto surfaceEvent = static_cast<QPlatformSurfaceEvent*>(event);
if (surfaceEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
d->setWinId(0);
break;
}
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();

View File

@ -524,6 +524,7 @@ private:
#ifdef Q_MOC_RUN
int xx = 11'11; // digit separator must not confuse moc (QTBUG-59351)
int xx = 0b11'11; // digit separator in a binary literal must not confuse moc (QTBUG-75656)
#endif
private slots: