summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-06-08 22:24:15 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-06-08 22:24:15 -0700
commitcddb6f08b4d1bb14e6fff4a6adcd6814ea582b8e (patch)
tree54968bce65fd597467f985d29a64624a00dfb118
parent3a005cdf983881612a70836dcd3ab816b0ea7698 (diff)
Enable EGL+GLES2 drawing when Wayland is selected
-rwxr-xr-xconfigure34
-rw-r--r--mkspecs/linux-g++/qmake.conf6
-rw-r--r--src/gui/egl/egl.pri10
-rw-r--r--src/gui/egl/qegl_wayland.cpp28
-rw-r--r--src/gui/gui.pro5
-rw-r--r--src/opengl/opengl.pro18
6 files changed, 52 insertions, 49 deletions
diff --git a/configure b/configure
index 53a7be5804..9012de0e06 100755
--- a/configure
+++ b/configure
@@ -1313,7 +1313,11 @@ while [ "$#" -gt 0 ]; do
PLATFORM_X11=yes
;;
wayland)
+ # Wayland needs EGL and GLES2
PLATFORM_WAYLAND=yes
+ CFG_GRAPHICS_SYSTEM=opengl
+ CFG_OPENGL=es2
+ CFG_EGL=yes
;;
sdk)
if [ "$PLATFORM_MAC" = "yes" ]; then
@@ -5918,6 +5922,36 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_WAYLAND" =
fi
fi
+if [ "$PLATFORM_WAYLAND" = "yes" ]; then
+ if [ "$CFG_OPENGL" = "yes" ]; then
+ CFG_EGL=auto
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
+ CFG_OPENGL=es2
+ else
+ echo "All the OpenGL ES functionality tests failed!"
+ echo " You might need to modify the include and library search paths by editing"
+ echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
+ echo " ${XQMAKESPEC}."
+ exit 1
+ fi
+ elif [ "$CFG_OPENGL" = "es2" ]; then
+ #OpenGL ES 2.x
+ "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
+ if [ $? != "0" ]; then
+ echo "The OpenGL ES 2.0 functionality test failed!"
+ echo " You might need to modify the include and library search paths by editing"
+ echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
+ echo " ${XQMAKESPEC}."
+ exit 1
+ fi
+ CFG_EGL=yes
+ elif [ "$CFG_OPENGL" = "desktop" ]; then
+ # Desktop OpenGL support
+ echo "Desktop OpenGL support is not avaliable on Qt on Wayland"
+ exit 1
+ fi
+fi
+
# freetype support
[ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
[ "x$PLATFORM_MAC" = "xyes" ] && CFG_LIBFREETYPE=no
diff --git a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf
index 4b218960c8..60c4ff8c21 100644
--- a/mkspecs/linux-g++/qmake.conf
+++ b/mkspecs/linux-g++/qmake.conf
@@ -12,3 +12,9 @@ QMAKE_INCREMENTAL_STYLE = sublib
include(../common/g++.conf)
include(../common/linux.conf)
load(qt_config)
+
+QMAKE_INCDIR_OPENGL_ES2=/opt/gfx-test/include
+QMAKE_LIBDIR_OPENGL_ES2=/opt/gfx-test/lib
+QMAKE_LIBS_OPENGL_ES2=-lGLESv2
+QMAKE_INCDIR_OPENGL=/opt/gfx-test/include
+QMAKE_LIBDIR_OPENGL=/opt/gfx-test/lib
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri
index c39c5ea9d9..4c7a5f8365 100644
--- a/src/gui/egl/egl.pri
+++ b/src/gui/egl/egl.pri
@@ -18,15 +18,15 @@ contains(QT_CONFIG, egl): {
} else {
symbian {
SOURCES += egl/qegl_symbian.cpp
- } else {
+ }
+ x11 {
SOURCES += egl/qegl_x11.cpp
}
+ wayland {
+ SOURCES += egl/qegl_wayland.cpp
+ }
}
}
-
- wayland {
- SOURCES += egl/qegl_wayland.cpp
- }
} else:symbian {
DEFINES += QT_NO_EGL
SOURCES += egl/qegl_stub.cpp
diff --git a/src/gui/egl/qegl_wayland.cpp b/src/gui/egl/qegl_wayland.cpp
index 7510dabca8..bfd745df2a 100644
--- a/src/gui/egl/qegl_wayland.cpp
+++ b/src/gui/egl/qegl_wayland.cpp
@@ -48,48 +48,20 @@
#if !defined(QT_NO_EGL)
-#include <qscreen_wayland.h>
-#include <qscreenproxy_wayland.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
QT_BEGIN_NAMESPACE
-static QScreen *screenForDevice(QPaintDevice *device)
-{
- QScreen *screen = qt_screen;
- if (!screen)
- return 0;
- if (screen->classId() == QScreen::MultiClass) {
- int screenNumber;
- if (device && device->devType() == QInternal::Widget)
- screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
- else
- screenNumber = 0;
- screen = screen->subScreens()[screenNumber];
- }
- while (screen->classId() == QScreen::ProxyClass ||
- screen->classId() == QScreen::TransformedClass) {
- screen = static_cast<QProxyScreen *>(screen)->screen();
- }
- return screen;
-}
-
// Set pixel format and other properties based on a paint device.
void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
{
if (!dev)
return;
- // Find the QGLScreen for this paint device.
- QScreen *screen = screenForDevice(dev);
- if (!screen)
- return;
int devType = dev->devType();
if (devType == QInternal::Image)
setPixelFormat(static_cast<QImage *>(dev)->format());
- else
- setPixelFormat(screen->pixelFormat());
}
EGLNativeDisplayType QEgl::nativeDisplay()
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index cbc2ac6577..6264081e5f 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -22,7 +22,10 @@ symbian {
include(kernel/symbian.pri)
include(s60framework/s60framework.pri)
}
-wayland:include(kernel/wayland.pri)
+wayland {
+ include(kernel/wayland.pri)
+ CONFIG += opengl
+}
#modules
include(animation/animation.pri)
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 2d2ed15899..90abe1e4f8 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -123,25 +123,13 @@ wayland {
qpixmapdata_waylandgl_p.h \
qwindowsurface_waylandgl_p.h
- } else {
- SOURCES += qgl_wayland.cpp \
- qglpixelbuffer_wayland.cpp
}
-
- contains(QT_CONFIG, fontconfig) {
- contains(QT_CONFIG, system-freetype) {
- embedded:CONFIG += opentype
- # pull in the proper freetype2 include directory
+ contains(QT_CONFIG, system-freetype) {
+ embedded:CONFIG += opentype
+ # pull in the proper freetype2 include directory
include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
LIBS_PRIVATE += -lfreetype
- } else {
- ### Note: how does this compile with a non-system freetype?
- # This probably does not compile
- }
- } else {
- DEFINES *= QT_NO_FREETYPE
}
-
LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD
}