From c1b9b024f8e5396ad8ce15be6e8528ed87e54fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 6 Jun 2011 12:37:55 +0200 Subject: Made tst_QWidget::repaintWhenChildDeleted() pass. Implement some missing functionality in QWidget::destroy(). (cherry picked from commit 0273bc5d22cd1fa08854b023f9b6c318fc75f3fa) --- src/gui/kernel/qwidget_qpa.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index c7ce99a..68b0645 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -129,6 +129,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) { Q_D(QWidget); + d->aboutToDestroy(); + if (!isWindow() && parentWidget()) + parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); + if ((windowType() == Qt::Popup)) qApp->d_func()->closePopup(this); @@ -136,6 +140,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (this == QApplicationPrivate::active_window) QApplication::setActiveWindow(0); + setAttribute(Qt::WA_WState_Created, false); + if (windowType() != Qt::Desktop) { if (destroySubWindows) { QObjectList childList(children()); @@ -155,6 +161,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) d->hide_sys(); } } + + d->setWinId(0); } } -- cgit v0.12 From dc80dfd80ce83ca32f7a6e1a3880d46d1004c573 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 7 Jun 2011 15:06:53 +0200 Subject: reset certain global variables on deletion qt_button_down needs to be reset to 0 if it points to the widget being deleted. Reviewed-by: Samuel --- src/gui/kernel/qwidget_qpa.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index 68b0645..ab1058f 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -132,6 +132,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) d->aboutToDestroy(); if (!isWindow() && parentWidget()) parentWidget()->d_func()->invalidateBuffer(d->effectiveRectFor(geometry())); + d->deactivateWidgetCleanup(); if ((windowType() == Qt::Popup)) qApp->d_func()->closePopup(this); @@ -420,6 +421,7 @@ void QWidgetPrivate::hide_sys() { Q_Q(QWidget); q->setAttribute(Qt::WA_Mapped, false); + deactivateWidgetCleanup(); if (!q->isWindow()) { QWidget *p = q->parentWidget(); if (p &&p->isVisible()) { -- cgit v0.12 From 47e6c8bc62d4264ac149f5f063bb8741dbe25def Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:34:42 +0200 Subject: Adding arm armv6 and armv7 as valid archs for mac builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Morten Johan Sørvig --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c05ac33..e113217 100755 --- a/configure +++ b/configure @@ -3272,14 +3272,14 @@ fi # process CFG_MAC_ARCHS if [ "$PLATFORM_MAC" = "yes" ]; then # check -arch arguments for validity. - ALLOWED="x86 ppc x86_64 ppc64 i386" + ALLOWED="x86 ppc x86_64 ppc64 i386 arm armv6 armv7" # Save the list so we can re-write it using only valid values CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS" CFG_MAC_ARCHS= for i in $CFG_MAC_ARCHS_IN do if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then - echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64"; + echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64 arm armv6 armv7"; exit 2; fi if [ "$i" = "i386" -o "$i" = "x86" ]; then -- cgit v0.12 From 3da1acfeda31604412b5826b9bfeeb73a4ff2779 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:36:28 +0200 Subject: Export IPHONEOS_DEPLOYMENT_TARGET from qmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Morten Johan Sørvig --- qmake/generators/mac/pbuilder_pbx.cpp | 2 ++ qmake/generators/unix/unixmake2.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index b7aec00..9a87eb6 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1324,6 +1324,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t\t" << writeSettings("DYLIB_COMPATIBILITY_VERSION", project->first("COMPAT_VERSION")) << ";" << "\n"; if(!project->isEmpty("QMAKE_MACOSX_DEPLOYMENT_TARGET")) t << "\t\t\t\t" << writeSettings("MACOSX_DEPLOYMENT_TARGET", project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET")) << ";" << "\n"; + if(!project->isEmpty("QMAKE_IPHONEOS_DEPLOYMENT_TARGET")) + t << "\t\t\t\t" << writeSettings("IPHONEOS_DEPLOYMENT_TARGET", project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET")) << ";" << "\n"; if(pbVersion >= 38) { if(!project->isEmpty("OBJECTS_DIR")) t << "\t\t\t\t" << writeSettings("OBJROOT", fixForOutput(project->first("OBJECTS_DIR"))) << ";" << "\n"; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 30d7822..fc951b1 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -179,6 +179,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "export MACOSX_DEPLOYMENT_TARGET = " //exported to children processes << project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET") << endl; + if(!project->isEmpty("QMAKE_IPHONEOS_DEPLOYMENT_TARGET")) + t << "export IPHONEOS_DEPLOYMENT_TARGET = " //exported to children processes + << project->first("QMAKE_IPHONEOS_DEPLOYMENT_TARGET") << endl; + if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(":") << endl; t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(":") << endl; -- cgit v0.12 From 5d5b6c79ab91d9d78e8e0ea5b5949dae3f8bf51c Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:38:20 +0200 Subject: Compile fixes in corelib for ios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jørgen Lind --- src/corelib/io/qfilesystemengine_unix.cpp | 11 ++++++++--- src/corelib/io/qfilesystemwatcher_fsevents.cpp | 24 +++++++++++++----------- src/corelib/io/qfilesystemwatcher_fsevents_p.h | 4 ++-- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index f1e0758..b0ebfbd 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -180,7 +180,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); #else char *ret = 0; -# if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) +# if defined(Q_OS_MAC) +# if !defined(QT_NO_CORESERVICES) // Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here. if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { ret = realpath(entry.nativeFilePath().constData(), (char*)0); @@ -197,9 +198,13 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, return QFileSystemEntry(ret); } } -# else +# else + ret = (char*)malloc(PATH_MAX); + realpath(entry.nativeFilePath().constData(), (char*)ret); +# endif //!defined(QT_NO_CORESERVICES) +# else ret = realpath(entry.nativeFilePath().constData(), (char*)0); -# endif +# endif //defined(Q_OS_MAC) if (ret) { data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; data.entryFlags |= QFileSystemMetaData::ExistsAttribute; diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp index 6ae6e38..4ae7cf8 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp +++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp @@ -57,13 +57,15 @@ #include #include #include +#if !defined( QT_NO_CORESERVICES ) #include +#endif #include #include QT_BEGIN_NAMESPACE -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) // Static operator overloading so for the sake of some convieniece. // They only live in this compilation unit to avoid polluting Qt in general. static bool operator==(const struct ::timespec &left, const struct ::timespec &right) @@ -152,7 +154,7 @@ QFSEventsFileSystemWatcherEngine::QFSEventsFileSystemWatcherEngine() QFSEventsFileSystemWatcherEngine::~QFSEventsFileSystemWatcherEngine() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) // I assume that at this point, QFileSystemWatcher has already called stop // on me, so I don't need to invalidate or stop my stream, simply // release it. @@ -171,7 +173,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, QStringList *files, QStringList *directories) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) stop(); wait(); QMutexLocker locker(&mutex); @@ -257,7 +259,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, void QFSEventsFileSystemWatcherEngine::warmUpFSEvents() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) // This function assumes that the mutex has already been grabbed before calling it. // It exits with the mutex still locked (Q_ASSERT(mutex.isLocked()) ;-). start(); @@ -269,7 +271,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat QStringList *files, QStringList *directories) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) stop(); wait(); QMutexLocker locker(&mutex); @@ -336,7 +338,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat #endif } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) void QFSEventsFileSystemWatcherEngine::updateList(PathInfoList &list, bool directory, bool emitSignals) { PathInfoList::iterator End = list.end(); @@ -396,7 +398,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef , const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId []) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) QFSEventsFileSystemWatcherEngine *watcher = static_cast(clientCallBackInfo); QMutexLocker locker(&watcher->mutex); CFArrayRef paths = static_cast(eventPaths); @@ -431,7 +433,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef , void QFSEventsFileSystemWatcherEngine::stop() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) QMutexLocker locker(&mutex); stopFSStream(fsStream); if (threadsRunLoop) { @@ -443,13 +445,13 @@ void QFSEventsFileSystemWatcherEngine::stop() void QFSEventsFileSystemWatcherEngine::updateFiles() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) QMutexLocker locker(&mutex); updateHash(filePathInfoHash); updateHash(dirPathInfoHash); if (filePathInfoHash.isEmpty() && dirPathInfoHash.isEmpty()) { // Everything disappeared before we got to start, don't bother. -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) // Code duplicated from stop(), with the exception that we // don't wait on waitForStop here. Doing this will lead to // a deadlock since this function is called from the worker @@ -467,7 +469,7 @@ void QFSEventsFileSystemWatcherEngine::updateFiles() void QFSEventsFileSystemWatcherEngine::run() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) threadsRunLoop = CFRunLoopGetCurrent(); FSEventStreamScheduleWithRunLoop(fsStream, threadsRunLoop, kCFRunLoopDefaultMode); bool startedOK = FSEventStreamStart(fsStream); diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h index 2466a6e..515c32e 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h +++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h @@ -74,7 +74,7 @@ typedef uint64_t FSEventStreamEventId; QT_BEGIN_NAMESPACE -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(QT_NO_CORESERVICES) // Yes, I use a stat64 element here. QFileInfo requires too much knowledge about implementation // details to be used as a long-standing record. Since I'm going to have to store this information, I can // do the stat myself too. @@ -117,7 +117,7 @@ private: QMutex mutex; QWaitCondition waitCondition; QWaitCondition waitForStop; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) PathHash filePathInfoHash; PathHash dirPathInfoHash; void updateHash(PathHash &pathHash); -- cgit v0.12 From 6d1bb2792df9bf16c0388e315f25e37308eec337 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:40:17 +0200 Subject: Don't redefine EGL defines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jørgen Lind --- src/gui/egl/qegl_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index 9b0d82e..15e7cab 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -165,13 +165,21 @@ typedef int EGLImageKHR; typedef void *EGLImageKHR; #endif +#if !defined(EGL_NO_IMAGE_KHR) #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) +#endif +#if !defined(EGL_IMAGE_PRESERVED_KHR) #define EGL_IMAGE_PRESERVED_KHR 0x30D2 +#endif +#if !defined(EGL_KHR_image_base) #define EGL_KHR_image_base #endif +#endif -#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap) +#if !defined(EGL_KHR_image) #define EGL_NATIVE_PIXMAP_KHR 0x30B0 +#endif +#if !defined(EGL_KHR_image_pixmap) #define EGL_KHR_image_pixmap #endif -- cgit v0.12 From 2c86d4a8685efada1bd4905b0b2e49a82ab24b75 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:41:11 +0200 Subject: Make it possible to compile in a screen plugin name in QWS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jørgen Lind --- src/gui/kernel/qapplication_qws.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 1197c77..abee361 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -2184,6 +2184,11 @@ void qt_init(QApplicationPrivate *priv, int type) qws_screen_is_interlaced = read_bool_env_var("QWS_INTERLACE",false); const char *display = ::getenv("QWS_DISPLAY"); + +#ifdef QT_QWS_DEFAULT_DRIVER_NAME + if (!display) display = QT_QWS_DEFAULT_DRIVER_NAME; +#endif + if (display) qws_display_spec = display; // since we setenv later! -- cgit v0.12 From 6f962aac021219306bd8f192ab34ec03317df89a Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 12:43:39 +0200 Subject: Compile fix in network for ios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jørgen Lind --- src/network/kernel/kernel.pri | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 6 +++--- src/network/ssl/qsslsocket_p.h | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index bb98305..e5d33bb 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -26,7 +26,7 @@ win32:SOURCES += kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp integrity:SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -mac:SOURCES += kernel/qnetworkproxy_mac.cpp +mac:contains(QT_CONFIG, coreservices) SOURCES += kernel/qnetworkproxy_mac.cpp else:win32:SOURCES += kernel/qnetworkproxy_win.cpp else:symbian:SOURCES += kernel/qnetworkproxy_symbian.cpp else:SOURCES += kernel/qnetworkproxy_generic.cpp diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 599c3f6..4747f29 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -68,7 +68,7 @@ #endif QT_BEGIN_NAMESPACE -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0; PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0; @@ -532,7 +532,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded() resetDefaultCiphers(); //load symbols needed to receive certificates from system store -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security"); if (securityLib.load()) { ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData"); @@ -813,7 +813,7 @@ QList QSslSocketPrivate::systemCaCertificates() timer.start(); #endif QList systemCerts; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) CFArrayRef cfCerts; OSStatus status = 1; diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 86ecba0..ee6361f 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -69,9 +69,11 @@ QT_BEGIN_NAMESPACE #if defined(Q_OS_MAC) #include #include +#ifndef QT_NO_CORESERVICES typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR); typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*); typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*); +#endif #elif defined(Q_OS_WIN) #include #include @@ -132,7 +134,7 @@ public: static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificates(const QList &certs); -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static PtrSecCertificateGetData ptrSecCertificateGetData; static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates; static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates; -- cgit v0.12 From c5a377e944f9a87c372ff8371c66b03d861803a6 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 8 Jun 2011 13:21:59 +0200 Subject: Adding debug output for not supported gl features in the gl2 paintengine Reviewed-by: Samuel --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 3ac759c..9ce7d55 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -90,6 +90,12 @@ QT_BEGIN_NAMESPACE +inline static bool isPowerOfTwo(int x) +{ + // Assumption: x >= 1 + return x == (x & -x); +} + #if defined(Q_WS_WIN) extern Q_GUI_EXPORT bool qt_cleartype_enabled; #endif @@ -201,6 +207,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture() glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); ctx->d_func()->bindTexture(texImage, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); +#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2) + QGLFunctions funcs(QGLContext::currentContext()); + bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); + bool isNpot = !isPowerOfTwo(texImage.size().width()) + || !isPowerOfTwo(texImage.size().height()); + if (isNpot && !npotSupported) { + qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures."); + } +#endif updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { @@ -233,6 +248,15 @@ void QGL2PaintEngineExPrivate::updateBrushTexture() QGLTexture *tex = ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption | QGLContext::CanFlipNativePixmapBindOption); +#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2) + QGLFunctions funcs(QGLContext::currentContext()); + bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); + bool isNpot = !isPowerOfTwo(currentBrushPixmap.size().width()) + || !isPowerOfTwo(currentBrushPixmap.size().height()); + if (isNpot && !npotSupported) { + qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures."); + } +#endif updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); textureInvertedY = tex->options & QGLContext::InvertedYBindOption ? -1 : 1; } @@ -1782,6 +1806,15 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp glActiveTexture(GL_TEXTURE0 + QT_MASK_TEXTURE_UNIT); glBindTexture(GL_TEXTURE_2D, cache->texture()); +#if !defined(QT_NO_DEBUG) && defined(QT_OPENGL_ES_2) + QGLFunctions funcs(QGLContext::currentContext()); + bool npotSupported = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); + bool isNpot = !isPowerOfTwo(cache->width()) + || !isPowerOfTwo(cache->height()); + if (isNpot && !npotSupported) { + qWarning("GL2 Paint Engine: This system does not support the REPEAT wrap mode for non-power-of-two textures."); + } +#endif updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false); #if defined(QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO) -- cgit v0.12