diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-04-16 12:04:34 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-04-16 12:04:34 +0200 |
commit | 9bd032355163d92cda5e7e59ecd21214b131f187 (patch) | |
tree | 002fa12558505683143c7eb08949a3d225bf0712 /mkspecs/devices/linux-rasp-pi-g++ | |
parent | d037d25c3d5236623371cf051aaf6a9e59792ba7 (diff) | |
parent | 41673c45dde2eb95ee21dd918235218399f2be2c (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
configure
src/corelib/io/qurl.cpp
src/gui/kernel/qwindow.cpp
src/tools/moc/generator.cpp
src/widgets/kernel/qwidget_qpa.cpp
src/widgets/styles/qstyle.h
src/widgets/widgets/qtabbar.cpp
tests/auto/corelib/codecs/utf8/tst_utf8.cpp
Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'mkspecs/devices/linux-rasp-pi-g++')
-rw-r--r-- | mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp (renamed from mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp) | 42 | ||||
-rw-r--r-- | mkspecs/devices/linux-rasp-pi-g++/qmake.conf | 2 |
2 files changed, 35 insertions, 9 deletions
diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp index 2cbd297a90..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,11 +145,25 @@ 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; } -QEglFSHooks platform_hooks; +bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedPixmaps: + case QPlatformIntegration::OpenGL: + case QPlatformIntegration::ThreadedOpenGL: + case QPlatformIntegration::BufferQueueingOpenGL: + return true; + default: + return false; + } +} + +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() |