From 18daa683a389abd42d71fd616e271b74ce749efc Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 8 Jul 2010 13:49:43 +0200 Subject: Add support for -runtimegraphicssystem configure option It has been requested that we provide a configuration option to specify the default "inner" graphics system that should be used when the runtime graphics system is in use. The argument specified to the option is written to the qconfig.h as QT_DEFAULT_RUNTIME_SYSTEM and this is used to instantiate the default graphics system that will be used by the runtime graphics system. Reviewed-by: Gunnar Sletta --- configure | 28 +++++++++++++++++++++++++++ configure.exe | Bin 1317888 -> 1309696 bytes src/gui/painting/qgraphicssystem_runtime.cpp | 9 ++++++--- tools/configure/configureapp.cpp | 16 +++++++++++---- 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/configure b/configure index d4d75a7..229611b 100755 --- a/configure +++ b/configure @@ -794,6 +794,7 @@ OPT_VERBOSE=no OPT_HELP= CFG_SILENT=no CFG_GRAPHICS_SYSTEM=default +CFG_RUNTIME_SYSTEM= CFG_ALSA=auto CFG_PULSEAUDIO=auto CFG_COREWLAN=auto @@ -1036,6 +1037,11 @@ while [ "$#" -gt 0 ]; do shift VAL=$1 ;; + -runtimegraphicssystem) + VAR="runtimegraphicssystem" + shift + VAL=$1 + ;; -qtlibinfix) VAR="qtlibinfix" shift @@ -1280,11 +1286,18 @@ while [ "$#" -gt 0 ]; do CFG_GRAPHICS_SYSTEM="openvg" elif [ "$VAL" = "raster" ]; then CFG_GRAPHICS_SYSTEM="raster" + elif [ "$VAL" = "runtime" ]; then + CFG_GRAPHICS_SYSTEM="runtime" else UNKNOWN_OPT=yes fi fi ;; + runtimegraphicssystem) + if [ "$VAL" != "runtime" ]; then + CFG_RUNTIME_SYSTEM="$VAL" + fi + ;; qvfb) # left for commandline compatibility, not documented if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then @@ -3677,6 +3690,8 @@ cat << EOF -graphicssystem Sets an alternate graphics system. Available options are: raster - Software rasterizer opengl - Rendering via OpenGL, Experimental! + openvg - Rendering via OpenVG, Experimental! + EOF fi cat << EOF @@ -6363,6 +6378,11 @@ if [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && [ "$CFG_OPENVG" = "no" ]; then CFG_GRAPHICS_SYSTEM=default fi +if [ -n "$CFG_RUNTIME_SYSTEM" -a "$CFG_GRAPHICS_SYSTEM" != "runtime" ] || [ "$CFG_RUNTIME_SYSTEM" = "runtime" ]; then + echo "Argument to -runtimegraphicssystem is invalid so ignoring..." + CFG_RUNTIME_SYSTEM= +fi + if [ "$CFG_PTMALLOC" != "no" ]; then # build ptmalloc, copy .a file to lib/ echo "Building ptmalloc. Please wait..." @@ -7666,6 +7686,7 @@ if [ "$PLATFORM_QWS" != "yes" ]; then [ "$CFG_GRAPHICS_SYSTEM" = "raster" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RASTER" [ "$CFG_GRAPHICS_SYSTEM" = "opengl" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENGL" [ "$CFG_GRAPHICS_SYSTEM" = "openvg" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_OPENVG" + [ "$CFG_GRAPHICS_SYSTEM" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_GRAPHICSSYSTEM_RUNTIME" fi # X11/Unix/Mac only configs @@ -7779,6 +7800,13 @@ cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF EOF fi +if [ -n "$CFG_RUNTIME_SYSTEM" ]; then +cat >>"$outpath/src/corelib/global/qconfig.h.new" << EOF +#define QT_DEFAULT_RUNTIME_SYSTEM "$CFG_RUNTIME_SYSTEM" + +EOF +fi + # avoid unecessary rebuilds by copying only if qconfig.h has changed if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then rm -f "$outpath/src/corelib/global/qconfig.h.new" diff --git a/configure.exe b/configure.exe index 6dfd14e48..220e605 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp index 3438137..568f4d7 100644 --- a/src/gui/painting/qgraphicssystem_runtime.cpp +++ b/src/gui/painting/qgraphicssystem_runtime.cpp @@ -346,11 +346,14 @@ QRuntimeGraphicsSystem::QRuntimeGraphicsSystem() QApplicationPrivate::graphics_system_name = QLatin1String("runtime"); QApplicationPrivate::runtime_graphics_system = true; +#ifdef QT_DEFAULT_RUNTIME_SYSTEM + m_graphicsSystemName = QLatin1String(QT_DEFAULT_RUNTIME_SYSTEM); + if (m_graphicsSystemName.isNull()) +#endif + m_graphicsSystemName = QLatin1String("raster"); + #ifdef Q_OS_SYMBIAN - m_graphicsSystemName = QLatin1String("openvg"); m_windowSurfaceDestroyPolicy = DestroyAfterFirstFlush; -#else - m_graphicsSystemName = QLatin1String("raster"); #endif m_graphicsSystem = QGraphicsSystemFactory::create(m_graphicsSystemName); diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b7de052..14b67a0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1159,6 +1159,13 @@ void Configure::parseCmdLine() dictionary["GRAPHICS_SYSTEM"] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-runtimegraphicssystem") { + ++i; + if (i == argCount) + break; + dictionary["RUNTIME_SYSTEM"] = configCmdLine.at(i); + } + else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) { // Scan to see if any specific modules and drivers are enabled or disabled for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) { @@ -1624,7 +1631,7 @@ bool Configure::displayHelp() "[-phonon] [-no-phonon-backend] [-phonon-backend]\n" "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" - "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg|runtime]\n\n", 0, 7); + "[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1729,9 +1736,7 @@ bool Configure::displayHelp() "Available values for :"); desc("GRAPHICS_SYSTEM", "raster", "", " raster - Software rasterizer", ' '); desc("GRAPHICS_SYSTEM", "opengl", "", " opengl - Using OpenGL acceleration, experimental!", ' '); - desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!", ' '); - desc("GRAPHICS_SYSTEM", "runtime", "", " runtime - Runtime switching of graphics sytems", ' '); - + desc("GRAPHICS_SYSTEM", "openvg", "", " openvg - Using OpenVG acceleration, experimental!\n", ' '); desc( "-help, -h, -?", "Display this information.\n"); @@ -3025,6 +3030,9 @@ void Configure::generateConfigfiles() tmpStream << endl << "// Compile time features" << endl; tmpStream << "#define QT_ARCH_" << dictionary["ARCHITECTURE"].toUpper() << endl; + if (dictionary["GRAPHICS_SYSTEM"] == "runtime" && dictionary["RUNTIME_SYSTEM"] != "runtime") + tmpStream << "#define QT_DEFAULT_RUNTIME_SYSTEM \"" << dictionary["RUNTIME_SYSTEM"] << "\"" << endl; + QStringList qconfigList; if (dictionary["STL"] == "no") qconfigList += "QT_NO_STL"; if (dictionary["STYLE_WINDOWS"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWS"; -- cgit v0.12