From: Jørgen Lind Date: Mon, 11 Apr 2011 12:00:15 +0000 (+0200) Subject: Make Qt-Compositor build the xcomposite backend as default X-Git-Tag: qt-v5.0.0-alpha1~318 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e3e130f74bf2c54544d9ce388aa32b8144790dd2;p=profile%2Fivi%2Fqtwayland.git Make Qt-Compositor build the xcomposite backend as default when Qt is built with opengl. Other plugins can be set by defining the environment variable: QT_WAYLAND_GL_CONFIG --- diff --git a/examples/qml-compositor/qml-compositor.pro b/examples/qml-compositor/qml-compositor.pro index 050a247..8fb49fb 100644 --- a/examples/qml-compositor/qml-compositor.pro +++ b/examples/qml-compositor/qml-compositor.pro @@ -7,11 +7,6 @@ TARGET = qml-compositor DEPENDPATH += . INCLUDEPATH += . -# comment out the following CONFIG lines to disable DRM -#CONFIG += wayland_gl -#CONFIG += mesa_egl -#CONFIG += dri2_xcb - # comment out the following to not use pkg-config in the pri files CONFIG += use_pkgconfig diff --git a/examples/qwidget-compositor/qt-compositor.pro b/examples/qwidget-compositor/qt-compositor.pro index 0c0001f..bd921a4 100644 --- a/examples/qwidget-compositor/qt-compositor.pro +++ b/examples/qwidget-compositor/qt-compositor.pro @@ -3,13 +3,6 @@ TARGET = qwidget-compositor DEPENDPATH += . INCLUDEPATH += . -# comment out the following CONFIG lines to disable DRM -#CONFIG += wayland_gl -#CONFIG += mesa_egl -#CONFIG += dri2_xcb -#CONFIG += xcomposite_glx -#CONFIG += xcomposite_egl - # comment out the following to not use pkg-config in the pri files CONFIG += use_pkgconfig diff --git a/src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri b/src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri index a86a5f7..641c7a9 100644 --- a/src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri +++ b/src/qt-compositor/hardware_integration/dri2_xcb/dri2_xcb.pri @@ -1,6 +1,8 @@ INCLUDEPATH += $$PWD/../private LIBS += -lxcb -lxcb-dri2 -lEGL +DEFINES += QT_COMPOSITOR_DRI2_XCB + SOURCES += \ $$PWD/dri2xcbhwintegration.cpp \ $$PWD/dri2xcbbuffer.cpp \ diff --git a/src/qt-compositor/hardware_integration/hardware_integration.pri b/src/qt-compositor/hardware_integration/hardware_integration.pri index 7e5ec42..8c82d08 100644 --- a/src/qt-compositor/hardware_integration/hardware_integration.pri +++ b/src/qt-compositor/hardware_integration/hardware_integration.pri @@ -1,30 +1,43 @@ +contains(QT_CONFIG, opengl) { HEADERS += \ $$PWD/graphicshardwareintegration.h SOURCES += \ $$PWD/graphicshardwareintegration.cpp -wayland_gl{ - contains(QT_CONFIG, opengl) { - DEFINES += QT_WAYLAND_GL_SUPPORT - QT += opengl + DEFINES += QT_COMPOSITOR_WAYLAND_GL + QT += opengl - contains(QT_CONFIG, opengles2) { - mesa_egl { - include (mesa_egl/mesa_egl.pri) - DEFINES += QT_COMPOSITOR_MESA_EGL - } - dri2_xcb { - include (dri2_xcb/dri2_xcb.pri) - DEFINES += QT_COMPOSITOR_DRI2_XCB - } - xcomposite_egl { - include (xcomposite_egl/xcomposite_egl.pri) - } + QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG) + contains(QT_CONFIG, opengles2) { + isEqual(QT_WAYLAND_GL_CONFIG, wayland_egl) { + QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG + CONFIG += mesa_egl + } else:isEqual(QT_WAYLAND_GL_CONFIG,dri2_xcb) { + QT_WAYLAND_GL_INTEGRATION = $$QT_WAYLAND_GL_CONFIG + CONFIG += dri2_xcb } else { - xcomposite_glx { - include (xcomposite_glx/xcomposite_glx.pri) - } + QT_WAYLAND_GL_INTEGRATION = xcomposite_egl + CONFIG += xcomposite_egl } + } else { + QT_WAYLAND_GL_INTEGRATION = xcomposite_glx + CONFIG += xcomposite_glx } + system(echo "Qt-Compositor configured with openGL: $$QT_WAYLAND_GL_INTEGRATION") +} else { + system(echo "Qt-Compositor configured as raster only compositor") +} + +mesa_egl { + include (mesa_egl/mesa_egl.pri) +} +dri2_xcb { + include (dri2_xcb/dri2_xcb.pri) +} +xcomposite_egl { + include (xcomposite_egl/xcomposite_egl.pri) +} +xcomposite_glx { + include (xcomposite_glx/xcomposite_glx.pri) } diff --git a/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri b/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri index bee73c1..1ac2dad 100644 --- a/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri +++ b/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri @@ -1,5 +1,7 @@ LIBS += -lEGL +DEFINES += QT_COMPOSITOR_MESA_EGL + SOURCES += \ $$PWD/mesaeglintegration.cpp diff --git a/src/qt-compositor/qt-compositor.pri b/src/qt-compositor/qt-compositor.pri index 048a458..a3b1cf8 100644 --- a/src/qt-compositor/qt-compositor.pri +++ b/src/qt-compositor/qt-compositor.pri @@ -16,14 +16,6 @@ use_pkgconfig { LIBS += -lwayland-server -lffi } -wayland_gl { - system(echo "Qt-Compositor configured with openGL") - QT += opengl - DEFINES += QT_COMPOSITOR_WAYLAND_GL -} else { - system(echo "Qt-Compositor configured as raster only compositor") -} - include ($$PWD/util/util.pri) include ($$PWD/wayland_wrapper/wayland_wrapper.pri) include ($$PWD/hardware_integration/hardware_integration.pri)