diff options
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp (renamed from mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp) | 32 | ||||
-rw-r--r-- | mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf | 2 | ||||
-rw-r--r-- | mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp (renamed from mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp) | 31 | ||||
-rw-r--r-- | mkspecs/devices/linux-rasp-pi-g++/qmake.conf | 2 |
4 files changed, 36 insertions, 31 deletions
diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp index 40fb2a336b..6655c50573 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include <EGL/fbdev_window.h> #include <stdio.h> #include <sys/ioctl.h> @@ -48,20 +48,15 @@ #include <fcntl.h> #include <linux/fb.h> -void QEglFSHooks::platformInit() +class QEglFS8726MHooks : public QEglFSHooks { -} +public: + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); +}; -void QEglFSHooks::platformDestroy() -{ -} - -EGLNativeDisplayType QEglFSHooks::platformDisplay() const -{ - return EGL_DEFAULT_DISPLAY; -} - -QSize QEglFSHooks::screenSize() const +QSize QEglFS8726MHooks::screenSize() const { int fd = open("/dev/fb0", O_RDONLY); if (fd == -1) { @@ -78,7 +73,7 @@ QSize QEglFSHooks::screenSize() const return QSize(vinfo.xres, vinfo.yres); } -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFS8726MHooks::createNativeWindow(const QSize &size) { fbdev_window *window = new fbdev_window; window->width = size.width(); @@ -87,14 +82,11 @@ EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) return window; } -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +void QEglFS8726MHooks::destroyNativeWindow(EGLNativeWindowType window) { delete window; } -bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const -{ - return false; -} +QEglFS8726MHooks eglFS8726MHooks; +QEglFSHooks *platformHooks = &eglFS8726MHooks; -QEglFSHooks platform_hooks; diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf index b0b02f32e6..7525397a65 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf @@ -31,6 +31,6 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE deviceSanityCheckCompiler() -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks_8726m.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_8726m.cpp load(qt_config) diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp index f17af55947..21052a5b63 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include <bcm_host.h> @@ -55,23 +55,35 @@ static DISPMANX_DISPLAY_HANDLE_T dispman_display = 0; static DISPMANX_UPDATE_HANDLE_T dispman_update = 0; -void QEglFSHooks::platformInit() +class QEglFSPiHooks : public QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +void QEglFSPiHooks::platformInit() { bcm_host_init(); } -EGLNativeDisplayType QEglFSHooks::platformDisplay() const +EGLNativeDisplayType QEglFSPiHooks::platformDisplay() const { dispman_display = vc_dispmanx_display_open(0/* LCD */); return EGL_DEFAULT_DISPLAY; } -void QEglFSHooks::platformDestroy() +void QEglFSPiHooks::platformDestroy() { vc_dispmanx_display_close(dispman_display); } -QSize QEglFSHooks::screenSize() const +QSize QEglFSPiHooks::screenSize() const { //both mechanisms work #if 1 @@ -98,7 +110,7 @@ QSize QEglFSHooks::screenSize() const #endif } -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFSPiHooks::createNativeWindow(const QSize &size) { VC_RECT_T dst_rect; dst_rect.x = 0; @@ -133,14 +145,14 @@ EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) return eglWindow; } -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +void QEglFSPiHooks::destroyNativeWindow(EGLNativeWindowType window) { EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window); vc_dispmanx_element_remove(dispman_update, eglWindow->element); delete eglWindow; } -bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const { switch (cap) { case QPlatformIntegration::ThreadedPixmaps: @@ -153,4 +165,5 @@ bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const } } -QEglFSHooks platform_hooks; +QEglFSPiHooks eglFSPiHooks; +QEglFSHooks *platformHooks = &eglFSPiHooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf index 326d6b3b61..4c75e0b0b2 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf @@ -48,7 +48,7 @@ QMAKE_CFLAGS_RELEASE += \ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp # Sanity check deviceSanityCheckCompiler() |