[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin.spec
^
|
|
[-]
[+]
|
Deleted |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.24.tar.bz2/hwcomposer/config.tests/hwcomposer2/hwcomposer2.pro
^
|
@@ -1,8 +0,0 @@
-TEMPLATE = app
-
-CONFIG += link_pkgconfig
-PKGCONFIG += android-headers
-
-TARGET = hwcomposer2
-
-SOURCES += main.cpp
|
[-]
[+]
|
Deleted |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.24.tar.bz2/hwcomposer/config.tests/hwcomposer2/main.cpp
^
|
@@ -1,6 +0,0 @@
-#include <hardware/hwcomposer2.h>
-
-int main()
-{
- return 0;
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.24.tar.bz2/hwcomposer/hwcomposer_backend_v20.cpp
^
|
@@ -1,454 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Jolla Ltd.
-** Contact: Thomas Perl <thomas.perl@jolla.com>
-**
-** 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$
-**
-****************************************************************************/
-
-#include <android-version.h>
-#include "hwcomposer_backend_v20.h"
-#include "qeglfswindow.h"
-
-#include <string>
-#include <QtCore/QElapsedTimer>
-#include <QtCore/QTimerEvent>
-#include <QtCore/QCoreApplication>
-#include <private/qwindow_p.h>
-
-#include "qsystrace_selector.h"
-
-#include <inttypes.h>
-
-// #ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
-
-// #define QPA_HWC_TIMING
-
-#ifdef QPA_HWC_TIMING
-#define QPA_HWC_TIMING_SAMPLE(variable) variable = timer.nsecsElapsed()
-static QElapsedTimer timer;
-static qint64 presentTime;
-static qint64 syncTime;
-static qint64 prepareTime;
-static qint64 setTime;
-#else
-#define QPA_HWC_TIMING_SAMPLE(variable)
-#endif
-
-struct HwcProcs_v20 : public HWC2EventListener
-{
- HwComposerBackend_v20 *backend;
- hwc2_display_t primaryDisplayId;
-};
-
-void hwc2_callback_vsync(HWC2EventListener* listener, int32_t /*sequenceId*/,
- hwc2_display_t /*display*/, int64_t /*timestamp*/)
-{
- static int counter = 0;
- ++counter;
- if (counter % 2)
- QSystrace::begin("graphics", "QPA::vsync", "");
- else
- QSystrace::end("graphics", "QPA::vsync", "");
-
- QCoreApplication::postEvent(static_cast<const HwcProcs_v20 *>(listener)->backend,
- new QEvent(QEvent::User));
-}
-
-void hwc2_callback_hotplug(HWC2EventListener* listener, int32_t sequenceId,
- hwc2_display_t display, bool connected,
- bool primaryDisplay)
-{
- qDebug("onHotplugReceived(%d, %" PRIu64 ", %s, %s)",
- sequenceId, display,
- connected ? "connected" : "disconnected",
- primaryDisplay ? "primary" : "external");
-
- if (primaryDisplay) {
- static_cast<HwcProcs_v20 *>(listener)->primaryDisplayId = display;
- }
-
- static_cast<const HwcProcs_v20 *>(listener)->backend->onHotplugReceived(
- sequenceId, display, connected, primaryDisplay);
-}
-
-void hwc2_callback_refresh(HWC2EventListener* /*listener*/, int32_t /*sequenceId*/,
- hwc2_display_t /*display*/)
-{
-}
-
-class HWC2Window : public HWComposerNativeWindow
-{
- private:
- hwc2_compat_layer_t *layer;
- hwc2_compat_display_t *hwcDisplay;
- int lastPresentFence = -1;
- bool m_syncBeforeSet;
- protected:
- void present(HWComposerNativeWindowBuffer *buffer);
-
- public:
-
- HWC2Window(unsigned int width, unsigned int height, unsigned int format,
- hwc2_compat_display_t *display, hwc2_compat_layer_t *layer);
- ~HWC2Window();
- void set();
-};
-
-HWC2Window::HWC2Window(unsigned int width, unsigned int height,
- unsigned int format, hwc2_compat_display_t* display,
- hwc2_compat_layer_t *layer) :
- HWComposerNativeWindow(width, height, format),
- layer(layer), hwcDisplay(display)
-{
- int bufferCount = qgetenv("QPA_HWC_BUFFER_COUNT").toInt();
- if (bufferCount)
- bufferCount = qBound(2, bufferCount, 8);
- else
- // default to triple-buffering as on Android
- bufferCount = 3;
- setBufferCount(bufferCount);
- m_syncBeforeSet = qEnvironmentVariableIsSet("QPA_HWC_SYNC_BEFORE_SET");
-}
-
-HWC2Window::~HWC2Window()
-{
- if (lastPresentFence != -1) {
- close(lastPresentFence);
- }
-}
-
-void HWC2Window::present(HWComposerNativeWindowBuffer *buffer)
-{
- uint32_t numTypes = 0;
- uint32_t numRequests = 0;
- int displayId = 0;
- hwc2_error_t error = HWC2_ERROR_NONE;
-
- QSystraceEvent trace("graphics", "QPA::present");
-
- QPA_HWC_TIMING_SAMPLE(presentTime);
-
- int acquireFenceFd = getFenceBufferFd(buffer);
-
- if (m_syncBeforeSet && acquireFenceFd >= 0) {
- sync_wait(acquireFenceFd, -1);
- close(acquireFenceFd);
- acquireFenceFd = -1;
- }
-
- error = hwc2_compat_display_validate(hwcDisplay, &numTypes,
- &numRequests);
- if (error != HWC2_ERROR_NONE && error != HWC2_ERROR_HAS_CHANGES) {
- qDebug("prepare: validate failed for display %d: %d", displayId, error);
- return;
- }
-
- if (numTypes || numRequests) {
- qDebug("prepare: validate required changes for display %d: %d",
- displayId, error);
- return;
- }
-
- error = hwc2_compat_display_accept_changes(hwcDisplay);
- if (error != HWC2_ERROR_NONE) {
- qDebug("prepare: acceptChanges failed: %d", error);
- return;
- }
-
- QPA_HWC_TIMING_SAMPLE(prepareTime);
-
- QSystrace::begin("graphics", "QPA::set_client_target", "");
- hwc2_compat_display_set_client_target(hwcDisplay, /* slot */0, buffer,
- acquireFenceFd,
- HAL_DATASPACE_UNKNOWN);
- QSystrace::end("graphics", "QPA::set_client_target", "");
-
|
[-]
[+]
|
Deleted |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.24.tar.bz2/hwcomposer/hwcomposer_backend_v20.h
^
|
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Jolla Ltd.
-** Contact: Thomas Perl <thomas.perl@jolla.com>
-**
-** 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_BACKEND_V20_H
-#define HWCOMPOSER_BACKEND_V20_H
-
-#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
-
-#include "hwcomposer_backend.h"
-// libhybris access to the native hwcomposer window
-#include <hwcomposer_window.h>
-
-#include <hybris/hwc2/hwc2_compatibility_layer.h>
-
-#include <QObject>
-#include <QBasicTimer>
-
-class HwcProcs_v20;
-class QWindow;
-
-class HwComposerBackend_v20 : public QObject, public HwComposerBackend {
-public:
- HwComposerBackend_v20(hw_module_t *hwc_module, void *libminisf);
- virtual ~HwComposerBackend_v20();
-
- virtual EGLNativeDisplayType display();
- virtual EGLNativeWindowType createWindow(int width, int height);
- virtual void destroyWindow(EGLNativeWindowType window);
- virtual void swap(EGLNativeDisplayType display, EGLSurface surface);
- virtual void sleepDisplay(bool sleep);
- virtual float refreshRate();
- virtual bool getScreenSizes(int *width, int *height, float *physical_width, float *physical_height);
-
- virtual bool requestUpdate(QEglFSWindow *window) Q_DECL_OVERRIDE;
-
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
- void handleVSyncEvent();
- bool event(QEvent *e) Q_DECL_OVERRIDE;
-
- void onHotplugReceived(int32_t sequenceId, hwc2_display_t display,
- bool connected, bool primaryDisplay);
-
- static int composerSequenceId;
-
-private:
- hwc2_compat_device_t* hwc2_device;
- hwc2_compat_display_t* hwc2_primary_display;
- hwc2_compat_layer_t* hwc2_primary_layer;
-
- bool m_displayOff;
- QBasicTimer m_deliverUpdateTimeout;
- QBasicTimer m_vsyncTimeout;
- QSet<QWindow *> m_pendingUpdate;
- HwcProcs_v20 *procs;
-};
-
-#endif /* HWC_PLUGIN_HAVE_HWCOMPOSER1_API */
-
-#endif /* HWCOMPOSER_BACKEND_V11_H */
|
[-]
[+]
|
Deleted |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.24.tar.bz2/hwcomposer/qsystrace_selector.h
^
|
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** 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
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer.pro
^
|
@@ -3,7 +3,6 @@
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QEglFShwcIntegrationPlugin
load(qt_plugin)
-load(configure)
INCLUDEPATH += .
DEPENDPATH += .
@@ -28,30 +27,8 @@
SOURCES += hwcomposer_backend_v11.cpp
HEADERS += hwcomposer_backend_v11.h
-HEADERS += qsystrace_selector.h
-QT += core-private gui-private dbus
-
-equals(QT_MAJOR_VERSION, 5) {
- versionAtLeast(QT_MINOR_VERSION, 8) {
- QT += egl_support-private waylandcompositor-private fontdatabase_support-private eventdispatcher_support-private theme_support-private
- } else {
- QT += compositor-private platformsupport-private
- }
-}
-
-equals(QT_MAJOR_VERSION, 6) {
- QT += waylandcompositor-private opengl
-}
-
-enable-sensors {
- QT += sensors
- DEFINES += WITH_SENSORS
-}
-
-enable-systrace {
- DEFINES += WITH_SYSTRACE
-}
+QT += core-private compositor-private gui-private platformsupport-private dbus
DEFINES += QEGL_EXTRA_DEBUG
CONFIG += egl qpa/genericunixfontdatabase
@@ -73,13 +50,6 @@
DEFINES += HWC_PLUGIN_HAVE_HWCOMPOSER1_API
}
-qtCompileTest(hwcomposer2) {
- PKGCONFIG += libhwc2
- DEFINES += HWC_PLUGIN_HAVE_HWCOMPOSER2_API
- SOURCES += hwcomposer_backend_v20.cpp
- HEADERS += hwcomposer_backend_v20.h
-}
-
# Avoid X11 header collision
DEFINES += MESA_EGL_NO_X11_HEADERS
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend.cpp
^
|
@@ -47,9 +47,6 @@
#endif
#include "hwcomposer_backend_v10.h"
#include "hwcomposer_backend_v11.h"
-#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER2_API
-#include "hwcomposer_backend_v20.h"
-#endif
extern "C" void *android_dlopen(const char *filename, int flags);
@@ -82,7 +79,7 @@
// the hardware composer one. Therefor we rely on using the fbdev HYBRIS_EGLPLATFORM
// here and use eglGetDisplay to initialize it.
if (qEnvironmentVariableIsEmpty("QT_QPA_NO_FRAMEBUFFER_FIRST")) {
- eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ eglGetDisplay(EGL_DEFAULT_DISPLAY);
}
// A reason for calling this method here is to initialize the binder
@@ -94,107 +91,89 @@
libminisf = android_dlopen("libminisf.so", RTLD_LAZY);
if (libminisf) {
- startMiniSurfaceFlinger = (void(*)(void))android_dlsym(libminisf, "startMiniSurfaceFlinger");
+ startMiniSurfaceFlinger = (void(*)(void))android_dlsym(libminisf, "startMiniSurfaceFlinger");
}
if (startMiniSurfaceFlinger) {
- startMiniSurfaceFlinger();
+ startMiniSurfaceFlinger();
} else {
- fprintf(stderr, "libminisf is incompatible or missing. Can not possibly start the SurfaceFlinger service. If you're experiencing troubles with media try updating droidmedia (and/or this plugin).");
+ fprintf(stderr, "libminisf is incompatible or missing. Can not possibly start the SurfaceFlinger service. If you're experiencing troubles with media try updating droidmedia (and/or this plugin).");
}
-#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER2_API
- if (!qEnvironmentVariableIsEmpty("QT_QPA_FORCE_HWC2")) {
- // Create hwcomposer backend directly without opening hardware module
- // because on some devices loading hwc2 module twice breaks graphics
- // (The first load is in the composer android service.)
- return new HwComposerBackend_v20(NULL, libminisf);
- }
-#endif
-
// Open hardware composer
- if (hw_get_module(HWC_HARDWARE_MODULE_ID, (const hw_module_t **)(&hwc_module)) == 0) {
- fprintf(stderr, "== hwcomposer module ==\n");
- fprintf(stderr, " * Address: %p\n", hwc_module);
- fprintf(stderr, " * Module API Version: %x\n", hwc_module->module_api_version);
- fprintf(stderr, " * HAL API Version: %x\n", hwc_module->hal_api_version); /* should be zero */
- fprintf(stderr, " * Identifier: %s\n", hwc_module->id);
- fprintf(stderr, " * Name: %s\n", hwc_module->name);
- fprintf(stderr, " * Author: %s\n", hwc_module->author);
- fprintf(stderr, "== hwcomposer module ==\n");
-
- // Open hardware composer device
- HWC_PLUGIN_ASSERT_ZERO(hwc_module->methods->open(hwc_module, HWC_HARDWARE_COMPOSER, &hwc_device));
-
- uint32_t version = interpreted_version(hwc_device);
-
- fprintf(stderr, "== hwcomposer device ==\n");
- fprintf(stderr, " * Version: %x (interpreted as %x)\n", hwc_device->version, version);
- fprintf(stderr, " * Module: %p\n", hwc_device->module);
- fprintf(stderr, "== hwcomposer device ==\n");
+ HWC_PLUGIN_ASSERT_ZERO(hw_get_module(HWC_HARDWARE_MODULE_ID, (const hw_module_t **)(&hwc_module)));
+
+ fprintf(stderr, "== hwcomposer module ==\n");
+ fprintf(stderr, " * Address: %p\n", hwc_module);
+ fprintf(stderr, " * Module API Version: %x\n", hwc_module->module_api_version);
+ fprintf(stderr, " * HAL API Version: %x\n", hwc_module->hal_api_version); /* should be zero */
+ fprintf(stderr, " * Identifier: %s\n", hwc_module->id);
+ fprintf(stderr, " * Name: %s\n", hwc_module->name);
+ fprintf(stderr, " * Author: %s\n", hwc_module->author);
+ fprintf(stderr, "== hwcomposer module ==\n");
+
+ // Open hardware composer device
+ HWC_PLUGIN_ASSERT_ZERO(hwc_module->methods->open(hwc_module, HWC_HARDWARE_COMPOSER, &hwc_device));
+
+ uint32_t version = interpreted_version(hwc_device);
+
+ fprintf(stderr, "== hwcomposer device ==\n");
+ fprintf(stderr, " * Version: %x (interpreted as %x)\n", hwc_device->version, version);
+ fprintf(stderr, " * Module: %p\n", hwc_device->module);
+ fprintf(stderr, "== hwcomposer device ==\n");
#ifdef HWC_DEVICE_API_VERSION_0_1
- // Special-case for old hw adaptations that have the version encoded in
- // legacy format, we have to check hwc_device->version directly, because
- // the constants are actually encoded in the old format
- if ((hwc_device->version == HWC_DEVICE_API_VERSION_0_1) ||
- (hwc_device->version == HWC_DEVICE_API_VERSION_0_2) ||
- (hwc_device->version == HWC_DEVICE_API_VERSION_0_3)) {
- return new HwComposerBackend_v0(hwc_module, hwc_device, libminisf);
- }
+ // Special-case for old hw adaptations that have the version encoded in
+ // legacy format, we have to check hwc_device->version directly, because
+ // the constants are actually encoded in the old format
+ if ((hwc_device->version == HWC_DEVICE_API_VERSION_0_1) ||
+ (hwc_device->version == HWC_DEVICE_API_VERSION_0_2) ||
+ (hwc_device->version == HWC_DEVICE_API_VERSION_0_3)) {
+ return new HwComposerBackend_v0(hwc_module, hwc_device, libminisf);
+ }
#endif
- // Determine which backend we use based on the supported module API version
- switch (version) {
+ // Determine which backend we use based on the supported module API version
+ switch (version) {
#ifdef HWC_DEVICE_API_VERSION_0_1
- case HWC_DEVICE_API_VERSION_0_1:
- case HWC_DEVICE_API_VERSION_0_2:
- case HWC_DEVICE_API_VERSION_0_3:
- return new HwComposerBackend_v0(hwc_module, hwc_device, libminisf);
+ case HWC_DEVICE_API_VERSION_0_1:
+ case HWC_DEVICE_API_VERSION_0_2:
+ case HWC_DEVICE_API_VERSION_0_3:
+ return new HwComposerBackend_v0(hwc_module, hwc_device, libminisf);
+ break;
#endif
#ifdef HWC_DEVICE_API_VERSION_1_0
- case HWC_DEVICE_API_VERSION_1_0:
- return new HwComposerBackend_v10(hwc_module, hwc_device, libminisf);
+ case HWC_DEVICE_API_VERSION_1_0:
+ return new HwComposerBackend_v10(hwc_module, hwc_device, libminisf);
+ break;
#endif /* HWC_DEVICE_API_VERSION_1_0 */
#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
- case HWC_DEVICE_API_VERSION_1_1:
+ case HWC_DEVICE_API_VERSION_1_1:
#ifdef HWC_DEVICE_API_VERSION_1_2
- case HWC_DEVICE_API_VERSION_1_2:
+ case HWC_DEVICE_API_VERSION_1_2:
#endif
#ifdef HWC_DEVICE_API_VERSION_1_3
- case HWC_DEVICE_API_VERSION_1_3:
+ case HWC_DEVICE_API_VERSION_1_3:
#endif
#ifdef HWC_DEVICE_API_VERSION_1_4
- case HWC_DEVICE_API_VERSION_1_4:
+ case HWC_DEVICE_API_VERSION_1_4:
#endif
#ifdef HWC_DEVICE_API_VERSION_1_5
- case HWC_DEVICE_API_VERSION_1_5:
+ case HWC_DEVICE_API_VERSION_1_5:
#endif
- // HWC_NUM_DISPLAY_TYPES is the actual size of the array, otherwise
- // underrun/overruns happen
- return new HwComposerBackend_v11(hwc_module, hwc_device, libminisf, HWC_NUM_DISPLAY_TYPES);
+ // HWC_NUM_DISPLAY_TYPES is the actual size of the array, otherwise
+ // underrun/overruns happen
+ return new HwComposerBackend_v11(hwc_module, hwc_device, libminisf, HWC_NUM_DISPLAY_TYPES);
+ break;
#endif /* HWC_PLUGIN_HAVE_HWCOMPOSER1_API */
-#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER2_API
- case HWC_DEVICE_API_VERSION_2_0:
- return new HwComposerBackend_v20(NULL, libminisf);
-#endif
- default:
- fprintf(stderr, "Unknown hwcomposer API: 0x%x/0x%x/0x%x\n",
- hwc_module->module_api_version,
- hwc_device->version,
- version);
- return NULL;
- }
- }
-#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER2_API
- else {
- // Create hwc2 backend directly if opening hardware module fails
- return new HwComposerBackend_v20(NULL, libminisf);
+ default:
+ fprintf(stderr, "Unknown hwcomposer API: 0x%x/0x%x/0x%x\n",
+ hwc_module->module_api_version,
+ hwc_device->version,
+ version);
+ return NULL;
+ break;
}
-#endif
-
- fprintf(stderr, "Unable to load hwcomposer module\n");
- return NULL;
}
void
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend.h
^
|
@@ -42,13 +42,10 @@
#ifndef HWCOMPOSER_BACKEND_H
#define HWCOMPOSER_BACKEND_H
-#include <android-config.h>
-
-#include <inttypes.h>
#include <sys/types.h>
#include <sync/sync.h>
-#include <stdint.h>
+#include <android-config.h>
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
@@ -67,7 +64,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 %" PRIxPTR, (#x), __func__, (intptr_t)res); }
+ qWarning("QPA-HWC: %s in %s returned %x", (#x), __func__, (unsigned int)res); }
// Evaluate "x", if it is NULL, exit with a fatal error
#define HWC_PLUGIN_FATAL(x) \
@@ -76,7 +73,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 %" PRIxPTR, (#x), __func__, (intptr_t)res); }
+ qFatal("QPA-HWC: %s in %s returned %x", (#x), __func__, (unsigned int)res); }
// Evaluate "x", if it doesn't return zero, exit with a fatal error
#define HWC_PLUGIN_ASSERT_ZERO(x) \
@@ -112,8 +109,6 @@
virtual void sleepDisplay(bool sleep) = 0;
virtual float refreshRate() = 0;
- virtual bool getScreenSizes(int *width, int *height, float *physical_width, float *physical_height) = 0;
-
virtual bool requestUpdate(QEglFSWindow *) { return false; }
protected:
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend_v0.cpp
^
|
@@ -38,11 +38,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <android-config.h>
+#include <android-version.h>
#if ANDROID_VERSION_MAJOR <= 4
-#include <hardware/hwcomposer_defs.h>
-#ifdef HWC_DEVICE_API_VERSION_0_1
#include "hwcomposer_backend_v0.h"
+#ifdef HWC_DEVICE_API_VERSION_0_1
+
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.4.tar.bz2/hwcomposer/hwcomposer_backend_v0.h
^
|
@@ -56,15 +56,6 @@
virtual void swap(EGLNativeDisplayType display, EGLSurface surface);
virtual void sleepDisplay(bool sleep);
virtual float refreshRate();
- virtual bool getScreenSizes(int *width, int *height, float *physical_width, float *physical_height)
- {
- *width = 0;
- *height = 0;
- *physical_width = 0;
- *physical_height = 0;
- // N/A
- return false;
- }
private:
hwc_composer_device_t *hwc_device;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend_v10.cpp
^
|
@@ -41,7 +41,6 @@
#include "hwcomposer_backend_v10.h"
-#include <inttypes.h>
#include <unistd.h>
#ifdef HWC_DEVICE_API_VERSION_1_0
@@ -92,14 +91,14 @@
fprintf(stderr, "dpy = %p\n", contents->dpy);
fprintf(stderr, "sur = %p\n", contents->sur);
fprintf(stderr, "flags = %x\n", contents->flags);
- fprintf(stderr, "numHwLayers = %zu\n", contents->numHwLayers);
- for (unsigned int i=0; i<contents->numHwLayers; i++) {
+ fprintf(stderr, "numHwLayers = %d\n", contents->numHwLayers);
+ for (int i=0; i<contents->numHwLayers; i++) {
hwc_layer_1_t *layer = &(contents->hwLayers[i]);
fprintf(stderr, "Layer %d (%p):\n"
- " type=%s, hints=%x, flags=%x, handle=%" PRIxPTR ", transform=%d, blending=%s\n"
+ " type=%s, hints=%x, flags=%x, handle=%x, transform=%d, blending=%s\n"
" sourceCrop={%d, %d, %d, %d}, displayFrame={%d, %d, %d, %d}\n"
- " visibleRegionScreen=<%zu rect(s)>, acquireFenceFd=%d, releaseFenceFd=%d\n",
- i, layer, comp_type_str(layer->compositionType), layer->hints, layer->flags, (uintptr_t)layer->handle,
+ " visibleRegionScreen=<%d rect(s)>, acquireFenceFd=%d, releaseFenceFd=%d\n",
+ i, layer, comp_type_str(layer->compositionType), layer->hints, layer->flags, layer->handle,
layer->transform, blending_type_str(layer->blending),
layer->sourceCrop.left, layer->sourceCrop.top, layer->sourceCrop.right, layer->sourceCrop.bottom,
layer->displayFrame.left, layer->displayFrame.top, layer->displayFrame.right, layer->displayFrame.bottom,
@@ -110,11 +109,11 @@
void
hwcv10_proc_invalidate(const struct hwc_procs* procs)
{
- fprintf(stderr, "%s: procs=%" PRIxPTR "\n", __func__, (uintptr_t)procs);
+ fprintf(stderr, "%s: procs=%x\n", __func__, procs);
}
void
-hwcv10_proc_vsync(const struct hwc_procs* /*procs*/, int /*disp*/, int64_t /*timestamp*/)
+hwcv10_proc_vsync(const struct hwc_procs* procs, int disp, int64_t timestamp)
{
//fprintf(stderr, "%s: procs=%x, disp=%d, timestamp=%.0f\n", __func__, procs, disp, (float)timestamp);
vsync_mutex.lock();
@@ -125,7 +124,7 @@
void
hwcv10_proc_hotplug(const struct hwc_procs* procs, int disp, int connected)
{
- fprintf(stderr, "%s: procs=%" PRIxPTR ", disp=%d, connected=%d\n", __func__, (uintptr_t)procs, disp, connected);
+ fprintf(stderr, "%s: procs=%x, disp=%d, connected=%d\n", __func__, procs, disp, connected);
}
static hwc_procs_t global_procs = {
@@ -219,7 +218,7 @@
}
void
-HwComposerBackend_v10::swap(EGLNativeDisplayType /*display*/, EGLSurface /*surface*/)
+HwComposerBackend_v10::swap(EGLNativeDisplayType display, EGLSurface surface)
{
HWC_PLUGIN_ASSERT_ZERO(!(hwc_list->retireFenceFd == -1));
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend_v10.h
^
|
@@ -60,15 +60,6 @@
virtual void swap(EGLNativeDisplayType display, EGLSurface surface);
virtual void sleepDisplay(bool sleep);
virtual float refreshRate();
- virtual bool getScreenSizes(int *width, int *height, float *physical_width, float *physical_height)
- {
- *width = 0;
- *height = 0;
- *physical_width = 0;
- *physical_height = 0;
- // N/A
- return false;
- }
private:
hwc_composer_device_1_t *hwc_device;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_backend_v11.cpp
^
|
@@ -48,7 +48,7 @@
#include <QtCore/QCoreApplication>
#include <private/qwindow_p.h>
-#include "qsystrace_selector.h"
+#include <private/qsystrace_p.h>
#ifdef HWC_PLUGIN_HAVE_HWCOMPOSER1_API
@@ -99,7 +99,6 @@
hwc_display_contents_1_t **mlist;
int num_displays;
bool m_syncBeforeSet;
- bool m_waitOnRetireFence;
protected:
void present(HWComposerNativeWindowBuffer *buffer);
@@ -123,7 +122,6 @@
int bufferCount = qBound(2, qgetenv("QPA_HWC_BUFFER_COUNT").toInt(), 8);
setBufferCount(bufferCount);
m_syncBeforeSet = qEnvironmentVariableIsSet("QPA_HWC_SYNC_BEFORE_SET");
- m_waitOnRetireFence = qEnvironmentVariableIsSet("QPA_HWC_WAIT_ON_RETIRE_FENCE");
}
void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
@@ -135,13 +133,6 @@
fblayer->handle = buffer->handle;
fblayer->releaseFenceFd = -1;
- int retireFenceFd = -1;
-
- if (m_waitOnRetireFence) {
- retireFenceFd = mlist[0]->retireFenceFd;
- mlist[0]->retireFenceFd = -1;
- }
-
if (m_syncBeforeSet) {
int acqFd = getFenceBufferFd(buffer);
if (acqFd >= 0) {
@@ -169,10 +160,7 @@
setFenceBufferFd(buffer, fblayer->releaseFenceFd);
- if (m_waitOnRetireFence && retireFenceFd != -1) {
- sync_wait(retireFenceFd, -1);
- close(retireFenceFd);
- } else if (!m_waitOnRetireFence && mlist[0]->retireFenceFd != -1) {
+ if (mlist[0]->retireFenceFd != -1) {
close(mlist[0]->retireFenceFd);
mlist[0]->retireFenceFd = -1;
}
@@ -393,80 +381,15 @@
}
}
-int HwComposerBackend_v11::getSingleAttribute(uint32_t attribute)
-{
- uint32_t config;
-
- if (hwc_version == HWC_DEVICE_API_VERSION_1_1
-#ifdef HWC_DEVICE_API_VERSION_1_2
- || hwc_version == HWC_DEVICE_API_VERSION_1_2
-#endif
-#ifdef HWC_DEVICE_API_VERSION_1_3
- || hwc_version == HWC_DEVICE_API_VERSION_1_3
-#endif
-)
- {
- /* 1.3 or lower, currently active config is the first config */
- size_t numConfigs = 1;
- hwc_device->getDisplayConfigs(hwc_device, 0, &config, &numConfigs);
- }
-#ifdef HWC_DEVICE_API_VERSION_1_4
- else {
- /* 1.4 or higher */
- config = hwc_device->getActiveConfig(hwc_device, 0);
- }
-#endif
-
- const uint32_t attributes[] = {
- attribute,
- HWC_DISPLAY_NO_ATTRIBUTE,
- };
-
- int32_t values[] = {
- 0,
- 0,
- };
-
- hwc_device->getDisplayAttributes(hwc_device, 0, config, attributes, values);
-
- for (unsigned int i = 0; i < sizeof(attributes) / sizeof(uint32_t); i++) {
- if (attributes[i] == attribute) {
- return values[i];
- }
- }
-
- return 0;
-}
-
float
HwComposerBackend_v11::refreshRate()
{
- float value = (float)getSingleAttribute(HWC_DISPLAY_VSYNC_PERIOD);
-
- value = (1000000000.0 / value);
-
- // make sure the value is "reasonable", otherwise fallback to 60.0.
- return (value > 0 && value <= 1000) ? value : 60.0;
-}
-
-bool
-HwComposerBackend_v11::getScreenSizes(int *width, int *height, float *physical_width, float *physical_height)
-{
- int dpi_x = getSingleAttribute(HWC_DISPLAY_DPI_X) / 1000;
- int dpi_y = getSingleAttribute(HWC_DISPLAY_DPI_Y) / 1000;
-
- *width = getSingleAttribute(HWC_DISPLAY_WIDTH);
- *height = getSingleAttribute(HWC_DISPLAY_HEIGHT);
-
- if (dpi_x == 0 || dpi_y == 0 || *width == 0 || *height == 0) {
- qWarning() << "failed to read screen size from hwc1.x backend";
- return false;
- }
-
- *physical_width = (((float)*width) * 25.4) / (float)dpi_x;
- *physical_height = (((float)*height) * 25.4) / (float)dpi_y;
-
- return true;
+ // TODO: Implement new hwc 1.1 querying of vsync period per-display
+ //
+ // from hwcomposer_defs.h:
+ // "This query is not used for HWC_DEVICE_API_VERSION_1_1 and later.
+ // Instead, the per-display attribute HWC_DISPLAY_VSYNC_PERIOD is used."
+ return 60.0;
}
void HwComposerBackend_v11::timerEvent(QTimerEvent *e)
@@ -488,7 +411,7 @@
bool HwComposerBackend_v11::event(QEvent *e)
{
if (e->type() == QEvent::User) {
- static int idleTime = qBound(5, qgetenv("QPA_HWC_IDLE_TIME").toInt(), 100);
+ static int idleTime = qBound(0, qgetenv("QPA_HWC_IDLE_TIME").toInt(), 100);
if (!m_deliverUpdateTimeout.isActive())
m_deliverUpdateTimeout.start(idleTime, this);
return true;
@@ -502,16 +425,8 @@
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.4.tar.bz2/hwcomposer/hwcomposer_backend_v11.h
^
|
@@ -49,7 +49,6 @@
// libhybris access to the native hwcomposer window
#include <hwcomposer_window.h>
-#include <QObject>
#include <QBasicTimer>
class HwcProcs_v11;
@@ -66,7 +65,6 @@
virtual void swap(EGLNativeDisplayType display, EGLSurface surface);
virtual void sleepDisplay(bool sleep);
virtual float refreshRate();
- virtual bool getScreenSizes(int *width, int *height, float *physical_width, float *physical_height);
virtual bool requestUpdate(QEglFSWindow *window) Q_DECL_OVERRIDE;
@@ -75,7 +73,6 @@
bool event(QEvent *e) Q_DECL_OVERRIDE;
private:
- int getSingleAttribute(uint32_t attribute);
hwc_composer_device_1_t *hwc_device;
hwc_display_contents_1_t *hwc_list;
hwc_display_contents_1_t **hwc_mList;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_context.cpp
^
|
@@ -52,22 +52,46 @@
#include <qcoreapplication.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include <inttypes.h>
+#include <unistd.h>
+#include <signal.h>
+
+
QT_BEGIN_NAMESPACE
+
+static void exit_qt_gracefully(int sig)
+{
+ qDebug("Exiting on signal: %d", sig);
+ QCoreApplication::exit(0);
+}
+
HwComposerContext::HwComposerContext()
- : info(NULL)
+ : info(new HwComposerScreenInfo())
, backend(NULL)
, display_off(false)
, window_created(false)
, fps(0)
{
+ // We need to catch the SIGTERM and SIGINT signals, so that we can do a
+ // proper shutdown of Qt and the plugin, and avoid crashes, hangs and
+ // reboots in cases where we don't properly close the hwcomposer.
+ struct sigaction new_action;
+ new_action.sa_handler = exit_qt_gracefully;
+ sigemptyset(&new_action.sa_mask);
+ new_action.sa_flags = 0;
+ sigaction(SIGTERM, &new_action, NULL);
+ sigaction(SIGINT, &new_action, NULL);
+
// This actually opens the hwcomposer device
backend = HwComposerBackend::create();
HWC_PLUGIN_ASSERT_NOT_NULL(backend);
fps = backend->refreshRate();
-
- info = new HwComposerScreenInfo(backend);
}
HwComposerContext::~HwComposerContext()
@@ -172,4 +196,6 @@
return false;
}
+
+
QT_END_NAMESPACE
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_context.h
^
|
@@ -47,21 +47,12 @@
#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(6, 0, 0))
-#include <QtGui/private/qeglplatformcontext_p.h>
-#elif (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.4.tar.bz2/hwcomposer/hwcomposer_screeninfo.cpp
^
|
@@ -40,7 +40,6 @@
****************************************************************************/
#include "hwcomposer_screeninfo.h"
-#include "hwcomposer_backend.h"
#include <private/qmath_p.h>
#include <private/qcore_unix_p.h>
@@ -206,48 +205,13 @@
int m_depth;
};
-class HwComposerScreenInfoHWCSource {
-public:
- HwComposerScreenInfoHWCSource(HwComposerBackend *backend) {
- m_have_values = backend->getScreenSizes(&m_width, &m_height, &m_physicalWidth, &m_physicalHeight);
- m_depth = 32;
- }
-
- QSizeF physicalScreenSize()
- {
- return QSizeF(m_physicalWidth, m_physicalHeight);
- }
-
- QSize screenSize()
- {
- return QSize(m_width, m_height);
- }
-
- int screenDepth()
- {
- return m_depth;
- }
-
- bool isValid()
- {
- return m_have_values;
- }
-
-private:
- float m_physicalWidth;
- float m_physicalHeight;
- int m_width;
- int m_height;
- int m_depth;
- bool m_have_values;
-};
} /* empty namespace */
QT_BEGIN_NAMESPACE
-HwComposerScreenInfo::HwComposerScreenInfo(HwComposerBackend *backend)
+HwComposerScreenInfo::HwComposerScreenInfo()
{
/**
* Look up the values in the following order of preference:
@@ -256,15 +220,12 @@
* 2. fbdev via FBIOGET_VSCREENINFO is preferred otherwise
* 3. Fallback values (with warnings) if 1. and 2. fail
**/
- HwComposerScreenInfoHWCSource hwcSource(backend);
HwComposerScreenInfoEnvironmentSource envSource;
HwComposerScreenInfoFbDevSource fbdevSource;
HwComposerScreenInfoFallbackSource fallbackSource;
if (envSource.hasScreenSize()) {
m_screenSize = envSource.screenSize();
- } else if (hwcSource.isValid()) {
- m_screenSize = hwcSource.screenSize();
} else if (fbdevSource.isValid()) {
m_screenSize = fbdevSource.screenSize();
} else {
@@ -273,8 +234,6 @@
if (envSource.hasPhysicalScreenSize()) {
m_physicalScreenSize = envSource.physicalScreenSize();
- } else if (hwcSource.isValid()) {
- m_physicalScreenSize = hwcSource.physicalScreenSize();
} else if (fbdevSource.isValid()) {
m_physicalScreenSize = fbdevSource.physicalScreenSize();
} else {
@@ -283,8 +242,6 @@
if (envSource.hasScreenDepth()) {
m_screenDepth = envSource.screenDepth();
- } else if (hwcSource.isValid()) {
- m_screenDepth = hwcSource.screenDepth();
} else if (fbdevSource.isValid()) {
m_screenDepth = fbdevSource.screenDepth();
} else {
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/hwcomposer_screeninfo.h
^
|
@@ -46,13 +46,11 @@
#include <QSizeF>
#include <QSize>
-class HwComposerBackend;
-
QT_BEGIN_NAMESPACE
class HwComposerScreenInfo {
public:
- HwComposerScreenInfo(HwComposerBackend *backend);
+ HwComposerScreenInfo();
QSizeF physicalScreenSize() const { return m_physicalScreenSize; }
QSize screenSize() const { return m_screenSize; }
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/qeglfsbackingstore.cpp
^
|
@@ -42,15 +42,9 @@
#include "qeglfsbackingstore.h"
#include "qeglfswindow.h"
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-#include <QtGui/QOpenGLContext>
-#include <QtOpenGL/QOpenGLPaintDevice>
-#include <QtOpenGL/QOpenGLShaderProgram>
-#else
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLPaintDevice>
#include <QtGui/QOpenGLShaderProgram>
-#endif
#include <QtGui/QScreen>
@@ -151,11 +145,7 @@
QRect imageRect = m_image.rect();
QRegion fixed;
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
- for (const QRect &rect : m_dirty) {
-#else
- for (const QRect &rect : m_dirty.rects()) {
-#endif
+ foreach (const QRect &rect, m_dirty.rects()) {
// intersect with image rect to be sure
QRect r = imageRect & rect;
@@ -169,11 +159,7 @@
fixed |= r;
}
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
- for (const QRect &rect : fixed) {
-#else
- for (const QRect &rect : fixed.rects()) {
-#endif
+ foreach (const QRect &rect, fixed.rects()) {
// if the sub-rect is full-width we can pass the image data directly to
// OpenGL instead of copying, since there's no gap between scanlines
if (rect.width() == imageRect.width()) {
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/qeglfscontext.cpp
^
|
@@ -42,15 +42,7 @@
#include "qeglfscontext.h"
#include "qeglfswindow.h"
#include "qeglfsintegration.h"
-
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-#include <QtGui/private/qeglpbuffer_p.h>
-#elif (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.4.tar.bz2/hwcomposer/qeglfscontext.h
^
|
@@ -42,18 +42,8 @@
#ifndef QEGLFSCONTEXT_H
#define QEGLFSCONTEXT_H
-#include <QtGlobal>
-
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-#include <QtGui/private/qeglconvenience_p.h>
-#include <QtGui/private/qeglplatformcontext_p.h>
-#elif (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.4.tar.bz2/hwcomposer/qeglfsintegration.cpp
^
|
@@ -46,28 +46,12 @@
#include <QtGui/private/qguiapplication_p.h>
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-#include <QtGui/private/qgenericunixfontdatabase_p.h>
-#include <QtGui/private/qgenericunixeventdispatcher_p.h>
-#include <QtGui/private/qgenericunixthemes_p.h>
-#include <QtGui/private/qeglconvenience_p.h>
-#include <QtGui/private/qeglplatformcontext_p.h>
-#include <QtGui/private/qeglpbuffer_p.h>
-#elif (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>
@@ -123,20 +107,14 @@
}
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 >= QT_VERSION_CHECK(5, 13, 0)
- QWindowSystemInterface::handleScreenRemoved(mScreen);
-#elif QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
+#if QT_VERSION >= 0x050500
destroyScreen(mScreen);
#else
delete mScreen;
|
[-]
[+]
|
Changed |
_service:tar_git:qt5-qpa-hwcomposer-plugin-5.6.2.4.tar.bz2/hwcomposer/qeglfsscreen.cpp
^
|
@@ -44,25 +44,11 @@
#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);
@@ -71,22 +57,7 @@
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
{
@@ -128,43 +99,4 @@
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.4.tar.bz2/hwcomposer/qeglfsscreen.h
^
|
@@ -49,23 +49,14 @@
#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();
@@ -81,10 +72,6 @@
qreal refreshRate() const;
-#ifdef WITH_SENSORS
- Qt::ScreenOrientation orientation() const;
-#endif
-
#if 0
QPlatformScreenPageFlipper *pageFlipper() const;
#endif
@@ -93,14 +80,6 @@
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.4.tar.bz2/hwcomposer/qeglfswindow.cpp
^
|
@@ -42,13 +42,7 @@
#include "qeglfswindow.h"
#include <qpa/qwindowsysteminterface.h>
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-#include <QtGui/private/qeglconvenience_p.h>
-#elif (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
-#include <QtEglSupport/private/qeglconvenience_p.h>
-#else
#include <QtPlatformSupport/private/qeglconvenience_p.h>
-#endif
#include <QtDebug>
|