summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 01:00:42 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-24 01:00:43 +0200
commita211c240a9bf92c0a9d1c3703420eff73d4f9cd6 (patch)
treea6bca2c76dc4fc90ab64c5b09db1ca1a51367501 /src/plugins
parent963941faae561aeadd3b3e97726d1b57e8bccf90 (diff)
parent70c053ee684448984b1f762abd3b40884cece2fa (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/android.pro8
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp2
-rw-r--r--src/plugins/platforms/android/main.cpp63
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm11
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm31
7 files changed, 76 insertions, 44 deletions
diff --git a/src/plugins/platforms/android/android.pro b/src/plugins/platforms/android/android.pro
index 346df84038..730247cd7f 100644
--- a/src/plugins/platforms/android/android.pro
+++ b/src/plugins/platforms/android/android.pro
@@ -1,9 +1,5 @@
TARGET = qtforandroid
-# STATICPLUGIN needed because there's a Q_IMPORT_PLUGIN in androidjnimain.cpp
-# Yes, the plugin imports itself statically
-DEFINES += QT_STATICPLUGIN
-
LIBS += -ljnigraphics -landroid
QT += \
@@ -19,7 +15,8 @@ INCLUDEPATH += \
$$PWD \
$$QT_SOURCE_TREE/src/3rdparty/android
-SOURCES += $$PWD/androidplatformplugin.cpp \
+SOURCES += $$PWD/main.cpp \
+ $$PWD/androidplatformplugin.cpp \
$$PWD/androidcontentfileengine.cpp \
$$PWD/androiddeadlockprotector.cpp \
$$PWD/androidjnimain.cpp \
@@ -92,4 +89,5 @@ qtConfig(vulkan) {
}
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QAndroidIntegrationPlugin
load(qt_plugin)
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 915f7f0f5b..27eb337aaa 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -68,8 +68,6 @@
#include <qpa/qwindowsysteminterface.h>
-Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
-
QT_BEGIN_NAMESPACE
static JavaVM *m_javaVM = nullptr;
diff --git a/src/plugins/platforms/android/main.cpp b/src/plugins/platforms/android/main.cpp
new file mode 100644
index 0000000000..c304fc8d69
--- /dev/null
+++ b/src/plugins/platforms/android/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 BogDan Vatra <bogdan@kde.org>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <qpa/qplatformintegrationplugin.h>
+#include "qandroidplatformintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+class QAndroidIntegrationPlugin : public QPlatformIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "android.json")
+
+public:
+ QPlatformIntegration *create(const QString& system, const QStringList& paramList) override;
+};
+
+QPlatformIntegration *QAndroidIntegrationPlugin::create(const QString& system, const QStringList& paramList)
+{
+ if (!system.compare(QLatin1String("android"), Qt::CaseInsensitive))
+ return new QAndroidPlatformIntegration(paramList);
+
+ return nullptr;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h
index 5edd274759..d8eb6b7b7f 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.h
+++ b/src/plugins/platforms/android/qandroidplatformwindow.h
@@ -65,8 +65,8 @@ public:
void setParent(const QPlatformWindow *window) override;
WId winId() const override { return m_windowId; }
- bool setMouseGrabEnabled(bool grab) override { return false; }
- bool setKeyboardGrabEnabled(bool grab) override { return false; }
+ bool setMouseGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; }
+ bool setKeyboardGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; }
QAndroidPlatformScreen *platformScreen() const;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index c6ce6e6819..fef72bc496 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -161,7 +161,6 @@ public:
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
- Q_NOTIFICATION_HANDLER(NSWindowDidChangeBackingPropertiesNotification) void windowDidChangeBackingProperties();
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
bool windowShouldClose();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index db4bc12210..35b7162346 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1262,17 +1262,6 @@ void QCocoaWindow::windowDidChangeScreen()
currentScreen->requestUpdate();
}
}
-/*
- The window's backing scale factor or color space has changed.
-*/
-void QCocoaWindow::windowDidChangeBackingProperties()
-{
- // Ideally we would plumb this thought QPA in a way that lets clients
- // invalidate their own caches, and recreate QBackingStore. For now we
- // trigger an expose, and let QCocoaBackingStore deal with its own
- // buffer invalidation.
- [m_view setNeedsDisplay:YES];
-}
void QCocoaWindow::windowWillClose()
{
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index d2e6f848a0..e72142466b 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -173,20 +173,6 @@
}
#endif
-- (void)updateMetalLayerDrawableSize:(CAMetalLayer *)layer
-{
- CGSize drawableSize = layer.bounds.size;
- drawableSize.width *= layer.contentsScale;
- drawableSize.height *= layer.contentsScale;
- layer.drawableSize = drawableSize;
-}
-
-- (void)layoutSublayersOfLayer:(CALayer *)layer
-{
- if ([layer isKindOfClass:CAMetalLayer.class])
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
-}
-
- (void)displayLayer:(CALayer *)layer
{
if (!NSThread.isMainThread) {
@@ -211,17 +197,16 @@
- (void)viewDidChangeBackingProperties
{
- CALayer *layer = self.layer;
- if (!layer)
- return;
+ qCDebug(lcQpaDrawing) << "Backing properties changed for" << self;
- layer.contentsScale = self.window.backingScaleFactor;
+ if (self.layer)
+ self.layer.contentsScale = self.window.backingScaleFactor;
- // Metal layers must be manually updated on e.g. screen change
- if ([layer isKindOfClass:CAMetalLayer.class]) {
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
- [self setNeedsDisplay:YES];
- }
+ // Ideally we would plumb this situation through QPA in a way that lets
+ // clients invalidate their own caches, recreate QBackingStore, etc.
+ // For now we trigger an expose, and let QCocoaBackingStore deal with
+ // buffer invalidation internally.
+ [self setNeedsDisplay:YES];
}
@end