[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.spec
^
|
|
[-]
[+]
|
Added |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/config.tests/hwcomposer2/hwcomposer2.pro
^
|
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+CONFIG += link_pkgconfig
+PKGCONFIG += android-headers
+
+TARGET = hwcomposer2
+
+SOURCES += main.cpp
|
[-]
[+]
|
Added |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/config.tests/hwcomposer2/main.cpp
^
|
@@ -0,0 +1,6 @@
+#include <hardware/hwcomposer2.h>
+
+int main()
+{
+ return 0;
+}
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer.pro
^
|
@@ -3,6 +3,7 @@
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QEglFShwcIntegrationPlugin
load(qt_plugin)
+load(configure)
INCLUDEPATH += .
DEPENDPATH += .
@@ -27,7 +28,22 @@
SOURCES += hwcomposer_backend_v11.cpp
HEADERS += hwcomposer_backend_v11.h
-QT += core-private compositor-private gui-private platformsupport-private dbus
+HEADERS += qsystrace_selector.h
+
+versionAtLeast(QT_MINOR_VERSION, 8) {
+ QT += core-private gui-private egl_support-private waylandcompositor-private dbus fontdatabase_support-private eventdispatcher_support-private theme_support-private
+} else {
+ QT += core-private compositor-private gui-private platformsupport-private dbus
+}
+
+enable-sensors {
+ QT += sensors
+ DEFINES += WITH_SENSORS
+}
+
+enable-systrace {
+ DEFINES += WITH_SYSTRACE
+}
DEFINES += QEGL_EXTRA_DEBUG
CONFIG += egl qpa/genericunixfontdatabase
@@ -49,7 +65,7 @@
DEFINES += HWC_PLUGIN_HAVE_HWCOMPOSER1_API
}
-exists(/usr/lib/droid-devel/droid-headers/hardware/hwcomposer2.h) {
+qtCompileTest(hwcomposer2) {
PKGCONFIG += libhwc2
DEFINES += HWC_PLUGIN_HAVE_HWCOMPOSER2_API
SOURCES += hwcomposer_backend_v20.cpp
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer_backend.h
^
|
@@ -44,6 +44,7 @@
#include <sys/types.h>
#include <sync/sync.h>
+#include <stdint.h>
#include <android-config.h>
#include <hardware/hardware.h>
@@ -64,7 +65,7 @@
// Evaluate "x", if it isn't NULL, print a warning
#define HWC_PLUGIN_EXPECT_NULL(x) \
{ void *res; if ((res = (x)) != NULL) \
- qWarning("QPA-HWC: %s in %s returned %x", (#x), __func__, (unsigned int)res); }
+ qWarning("QPA-HWC: %s in %s returned %x", (#x), __func__, (intptr_t)res); }
// Evaluate "x", if it is NULL, exit with a fatal error
#define HWC_PLUGIN_FATAL(x) \
@@ -73,7 +74,7 @@
// Evaluate "x", if it is NULL, exit with a fatal error
#define HWC_PLUGIN_ASSERT_NOT_NULL(x) \
{ void *res; if ((res = (x)) == NULL) \
- qFatal("QPA-HWC: %s in %s returned %x", (#x), __func__, (unsigned int)res); }
+ qFatal("QPA-HWC: %s in %s returned %x", (#x), __func__, (intptr_t)res); }
// Evaluate "x", if it doesn't return zero, exit with a fatal error
#define HWC_PLUGIN_ASSERT_ZERO(x) \
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer_backend_v0.cpp
^
|
@@ -40,9 +40,9 @@
****************************************************************************/
#include <android-version.h>
#if ANDROID_VERSION_MAJOR <= 4
-#include "hwcomposer_backend_v0.h"
+#include <hardware/hwcomposer_defs.h>
#ifdef HWC_DEVICE_API_VERSION_0_1
-
+#include "hwcomposer_backend_v0.h"
HwComposerBackend_v0::HwComposerBackend_v0(hw_module_t *hwc_module, hw_device_t *hw_device, void *libminisf)
: HwComposerBackend(hwc_module, libminisf)
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer_backend_v11.cpp
^
|
@@ -48,7 +48,7 @@
#include <QtCore/QCoreApplication>
#include <private/qwindow_p.h>
-#include <private/qsystrace_p.h>
+#include "qsystrace_selector.h"
#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
@@ -502,8 +502,16 @@
QSet<QWindow *> pendingWindows = m_pendingUpdate;
m_pendingUpdate.clear();
foreach (QWindow *w, pendingWindows) {
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ QPlatformWindow *platformWindow = w->handle();
+ if (!platformWindow)
+ continue;
+
+ platformWindow->deliverUpdateRequest();
+#else
QWindowPrivate *wp = (QWindowPrivate *) QWindowPrivate::get(w);
wp->deliverUpdateRequest();
+#endif
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer_backend_v20.cpp
^
|
@@ -49,7 +49,7 @@
#include <QtCore/QCoreApplication>
#include <private/qwindow_p.h>
-#include <private/qsystrace_p.h>
+#include "qsystrace_selector.h"
#include <inttypes.h>
@@ -246,7 +246,7 @@
{
hwc2_compat_display_set_vsync_enabled(hwc2_primary_display, HWC2_VSYNC_DISABLE);
- hwc2_compat_display_set_power_mode(hwc2_primary_display, HWC2_POWER_MODE_DOZE);
+ hwc2_compat_display_set_power_mode(hwc2_primary_display, HWC2_POWER_MODE_OFF);
// Close the hwcomposer handle
if (!qgetenv("QPA_HWC_WORKAROUNDS").split(',').contains("no-close-hwc"))
@@ -405,8 +405,16 @@
QSet<QWindow *> pendingWindows = m_pendingUpdate;
m_pendingUpdate.clear();
foreach (QWindow *w, pendingWindows) {
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ QPlatformWindow *platformWindow = w->handle();
+ if (!platformWindow)
+ continue;
+
+ platformWindow->deliverUpdateRequest();
+#else
QWindowPrivate *wp = (QWindowPrivate *) QWindowPrivate::get(w);
wp->deliverUpdateRequest();
+#endif
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/hwcomposer_context.h
^
|
@@ -47,12 +47,19 @@
#ifndef HWCOMPOSER_CONTEXT_H
#define HWCOMPOSER_CONTEXT_H
+#include <QtGlobal>
+
#include <qpa/qplatformintegration.h>
#include <qpa/qplatformscreen.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QImage>
#include <EGL/egl.h>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+#include <QtEglSupport/private/qeglplatformcontext_p.h>
+#else
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
+#endif
QT_BEGIN_NAMESPACE
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfscontext.cpp
^
|
@@ -42,7 +42,13 @@
#include "qeglfscontext.h"
#include "qeglfswindow.h"
#include "qeglfsintegration.h"
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+#include <QtEglSupport/private/qeglpbuffer_p.h>
+#else
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+#endif
+
#include <QtGui/QSurface>
#include <QtDebug>
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfscontext.h
^
|
@@ -42,8 +42,16 @@
#ifndef QEGLFSCONTEXT_H
#define QEGLFSCONTEXT_H
+#include <QtGlobal>
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+
+#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglplatformcontext_p.h>
+#else
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
+#endif
#include "hwcomposer_context.h"
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfsintegration.cpp
^
|
@@ -46,12 +46,21 @@
#include <QtGui/private/qguiapplication_p.h>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
+#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
+#include <QtThemeSupport/private/qgenericunixthemes_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglplatformcontext_p.h>
+#include <QtEglSupport/private/qeglpbuffer_p.h>
+#else
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#include <QtPlatformSupport/private/qgenericunixthemes_p.h>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+#endif
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformservices.h>
@@ -107,14 +116,20 @@
}
mScreen = new QEglFSScreen(mHwc, mDisplay);
+#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
screenAdded(mScreen);
+#else
+ QWindowSystemInterface::handleScreenAdded(mScreen);
+#endif
mInputContext = QPlatformInputContextFactory::create();
}
QEglFSIntegration::~QEglFSIntegration()
{
-#if QT_VERSION >= 0x050500
+#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
+ QWindowSystemInterface::handleScreenRemoved(mScreen);
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
destroyScreen(mScreen);
#else
delete mScreen;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfsscreen.cpp
^
|
@@ -44,11 +44,25 @@
#include <private/qmath_p.h>
+#ifdef WITH_SENSORS
+#include <QtSensors/QSensorManager>
+#include <QtSensors/QOrientationSensor>
+#include <QtSensors/QOrientationFilter>
+#include <QtSensors/QOrientationReading>
+#include <qpa/qwindowsysteminterface.h>
+
+#include <QTimer>
+#endif
+
QT_BEGIN_NAMESPACE
QEglFSScreen::QEglFSScreen(HwComposerContext *hwc, EGLDisplay dpy)
: m_hwc(hwc)
, m_dpy(dpy)
+#ifdef WITH_SENSORS
+ , m_screenOrientation(Qt::PrimaryOrientation)
+ , m_orientationSensor(new QOrientationSensor(this))
+#endif
{
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglScreen %p\n", this);
@@ -57,7 +71,22 @@
QEglFSScreen::~QEglFSScreen()
{
+#ifdef WITH_SENSORS
+ if (m_orientationSensor) {
+ m_orientationSensor->stop();
+ delete m_orientationSensor; m_orientationSensor = NULL;
+ }
+#endif
+}
+
+#ifdef WITH_SENSORS
+void QEglFSScreen::onStarted()
+{
+ if (!m_orientationSensor->isActive()) {
+ m_orientationSensor->start();
+ }
}
+#endif
QRect QEglFSScreen::geometry() const
{
@@ -99,4 +128,43 @@
return m_hwc->refreshRate();
}
+#ifdef WITH_SENSORS
+void QEglFSScreen::orientationReadingChanged()
+{
+ QSize screenSize = m_hwc->screenSize();
+ Qt::ScreenOrientation screenPrimaryOrientation = Qt::PortraitOrientation;
+ if (screenSize.width() > screenSize.height()) {
+ screenPrimaryOrientation = Qt::LandscapeOrientation;
+ }
+
+ QOrientationReading *orientationReading = m_orientationSensor->reading();
+ QOrientationReading::Orientation currentOrientation = orientationReading->orientation();
+
+ switch (currentOrientation) {
+ case QOrientationReading::TopUp: /* 0 */
+ m_screenOrientation = screenPrimaryOrientation;
+ break;
+ case QOrientationReading::LeftUp: /* 90 clockwise */
+ m_screenOrientation = screenPrimaryOrientation == Qt::PortraitOrientation ?
+ Qt::InvertedLandscapeOrientation : Qt::PortraitOrientation;
+ break;
+ case QOrientationReading::TopDown: /* 180 */
+ m_screenOrientation = screenPrimaryOrientation == Qt::PortraitOrientation ?
+ Qt::InvertedPortraitOrientation : Qt::InvertedLandscapeOrientation;
+ break;
+ case QOrientationReading::RightUp: /* 270 clockwise */
+ m_screenOrientation = screenPrimaryOrientation == Qt::PortraitOrientation ?
+ Qt::LandscapeOrientation : Qt::InvertedPortraitOrientation;
+ break;
+ }
+
+ QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_screenOrientation);
+}
+
+Qt::ScreenOrientation QEglFSScreen::orientation() const
+{
+ return m_screenOrientation;
+}
+#endif
+
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfsscreen.h
^
|
@@ -49,14 +49,23 @@
#include <EGL/egl.h>
+#ifdef WITH_SENSORS
+class QOrientationSensor;
+#endif
QT_BEGIN_NAMESPACE
class QEglFSPageFlipper;
class QPlatformOpenGLContext;
+#ifdef WITH_SENSORS
+class QEglFSScreen : public QObject, public QPlatformScreen //huh: FullScreenScreen ;) just to follow namespace
+{
+ Q_OBJECT
+#else
class QEglFSScreen : public QPlatformScreen //huh: FullScreenScreen ;) just to follow namespace
{
+#endif
public:
QEglFSScreen(HwComposerContext *hwc, EGLDisplay display);
~QEglFSScreen();
@@ -72,6 +81,10 @@
qreal refreshRate() const;
+#ifdef WITH_SENSORS
+ Qt::ScreenOrientation orientation() const;
+#endif
+
#if 0
QPlatformScreenPageFlipper *pageFlipper() const;
#endif
@@ -80,6 +93,14 @@
HwComposerContext *m_hwc;
QEglFSPageFlipper *m_pageFlipper;
EGLDisplay m_dpy;
+#ifdef WITH_SENSORS
+ Qt::ScreenOrientation m_screenOrientation;
+ QOrientationSensor *m_orientationSensor;
+
+private Q_SLOTS:
+ void orientationReadingChanged();
+ void onStarted();
+#endif
};
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qeglfswindow.cpp
^
|
@@ -42,7 +42,11 @@
#include "qeglfswindow.h"
#include <qpa/qwindowsysteminterface.h>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
+#include <QtEglSupport/private/qeglconvenience_p.h>
+#else
#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#endif
#include <QtDebug>
|
[-]
[+]
|
Added |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.18.tar.bz2/hwcomposer/qsystrace_selector.h
^
|
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** This file is part of the hwcomposer plugin.
+**
+** $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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HWCOMPOSER_QSYSTRACE_SELECTOR_H
+#define HWCOMPOSER_QSYSTRACE_SELECTOR_H
+
+#ifdef WITH_SYSTRACE
+#include <private/qsystrace_p.h>
+#else
+// Add dummy stub methods for QSysTrace
+namespace QSystrace
+{
+ inline void begin(const char *module, const char *tracepoint, const char *message, ...) {}
+ inline void end(const char *module, const char *tracepoint, const char *message, ...) {}
+ inline void counter(const char *module, const char *tracepoint, const char *message, ...) {}
+};
+struct QSystraceEvent {
+ QSystraceEvent(const char *module, const char *tracepoint) {}
+};
+#endif
+
+
+#endif
|