summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformintegration.h
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2020-08-25 11:32:58 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2020-08-27 23:35:16 +0300
commitfc4a73aa544bf03d881ddb7e2eb8ebd47d7da7b8 (patch)
tree6e0a334fa3b9535541d546ecffc890cbb4307a6a /src/plugins/platforms/android/qandroidplatformintegration.h
parent15db957585828af7a83896963fade95c3ddcc7e3 (diff)
Add QOffScreenSurface platform API abstraction
This follows the work done in 6ff79478a44fce12ca18832a56db4a370a9ff417. The API is available by including qoffscreensurface.h, scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QAndroidPlatformOffscreenSurface::fromNative(ANativeWindow); b) Access to underlying native handles, e.g. surface->platformInterface<QAndroidPlatformOffscreenSurface>() ->nativeSurface() Fixes: QTBUG-85874 Change-Id: I29c459866e0355a52320d5d473e8b147e050acb3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformintegration.h')
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h
index 30ab42ab34..012616839c 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/qandroidplatformintegration.h
@@ -40,19 +40,17 @@
#ifndef QANDROIDPLATFORMINTERATION_H
#define QANDROIDPLATFORMINTERATION_H
-#include <QtGui/qtguiglobal.h>
+#include "qandroidinputcontext.h"
+#include "qandroidplatformscreen.h"
+#include <QtGui/qtguiglobal.h>
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformmenu.h>
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qplatformoffscreensurface.h>
#include <EGL/egl.h>
-#include <jni.h>
-#include "qandroidinputcontext.h"
-
-#include "qandroidplatformscreen.h"
-
#include <memory>
QT_BEGIN_NAMESPACE
@@ -75,6 +73,7 @@ protected:
class QAndroidPlatformIntegration : public QPlatformIntegration
, QPlatformInterface::Private::QEGLIntegration
+ , QPlatformInterface::Private::QAndroidOffScreenIntegration
{
friend class QAndroidPlatformScreen;
@@ -94,6 +93,7 @@ public:
QAbstractEventDispatcher *createEventDispatcher() const override;
QAndroidPlatformScreen *screen() { return m_primaryScreen; }
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
+ QOffscreenSurface *createOffscreenSurface(ANativeWindow *nativeSurface) const override;
void setAvailableGeometry(const QRect &availableGeometry);
void setPhysicalSize(int width, int height);