summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-10-07 14:21:59 +0200
committerLiang Qi <liang.qi@nokia.com>2011-10-07 14:21:59 +0200
commit7cf9030bd7a50b6d98d454510417c6ecc3f33d49 (patch)
tree7c5c562ba490e217d8cef81ff1fd5958a0cacccb /src
parent7f3cd2949ccb16b1b611c05bf6ab7274cf04a0f8 (diff)
parent96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9 (diff)
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: doc/src/getting-started/installation.qdoc doc/src/platforms/platform-notes.qdoc src/corelib/tools/qlocale_symbian.cpp src/gui/kernel/qwidget_p.h src/network/access/qnetworkaccesshttpbackend.cpp src/opengl/qgl.cpp src/plugins/bearer/symbian/qnetworksession_impl.cpp
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp10
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h2
-rw-r--r--src/gui/egl/qegl.cpp32
-rw-r--r--src/gui/kernel/qcursor_win.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp24
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp58
-rw-r--r--src/gui/painting/qgraphicssystemex_symbian.cpp107
-rw-r--r--src/gui/widgets/qlinecontrol.cpp4
-rw-r--r--src/network/access/qhttpnetworkreply.cpp2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp23
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h2
-rw-r--r--src/opengl/qgl.cpp20
13 files changed, 238 insertions, 49 deletions
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index bf261ef242..c2f00865ef 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -46,6 +46,7 @@
#include <QtCore/qfileinfo.h>
#include <QtCore/qpluginloader.h>
#include <QtCore/qlibraryinfo.h>
+#include <QtCore/qalgorithms.h>
#include <QtDeclarative/qdeclarativeextensioninterface.h>
#include <private/qdeclarativeglobal_p.h>
#include <private/qdeclarativetypenamecache_p.h>
@@ -734,8 +735,12 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
}
RFs& fs = qt_s60GetRFs();
TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData()));
+ // Symbian searches should start from Y:. Fix start drive otherwise TFindFile starts from the session drive
+ _LIT(KStartDir, "Y:");
+ TFileName dirPath(KStartDir);
+ dirPath.Append(tempPathPtr);
TFindFile finder(fs);
- TInt err = finder.FindByDir(tempPathPtr, tempPathPtr);
+ TInt err = finder.FindByDir(tempPathPtr, dirPath);
while (err == KErrNone) {
QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()),
finder.File().Length());
@@ -743,6 +748,9 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
addImportPath(foundDir);
err = finder.Find();
}
+ // TFindFile found the directories in the order we want, but addImportPath reverses it.
+ // Reverse the order again to get it right.
+ QAlgorithmsPrivate::qReverse(fileImportPath.begin(), fileImportPath.end());
} else {
addImportPath(installImportsPath);
}
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index 581f5197f4..c648d25cb7 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -111,7 +111,7 @@ public:
int relatedIndex; // When IsFunction
};
uint overrideIndexIsProperty : 1;
- int overrideIndex : 31;
+ signed int overrideIndex : 31;
int revision;
int metaObjectOffset;
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 2a37d45089..6fe1c8c446 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -684,6 +684,37 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglPr
else
props = 0;
EGLSurface surf;
+#ifdef Q_OS_SYMBIAN
+ // On Symbian there might be situations (especially on 32MB GPU devices)
+ // where Qt is trying to create EGL surface while some other application
+ // is still holding all available GPU memory but is about to release it
+ // soon. For an example when exiting native video recorder and going back to
+ // Qt application behind it. Video stack tear down takes some time and Qt
+ // app might be too quick in reserving its EGL surface and thus running out
+ // of GPU memory right away. So if EGL surface creation fails due to bad
+ // alloc, let's try recreating it four times within ~1 second if needed.
+ // This strategy gives some time for video recorder to tear down its stack
+ // and a chance to Qt for creating a valid surface.
+ int tries = 4;
+ while(tries--) {
+ if (devType == QInternal::Widget)
+ surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props);
+ else
+ surf = eglCreatePixmapSurface(QEgl::display(), cfg, pixmapDrawable, props);
+ if (surf == EGL_NO_SURFACE) {
+ EGLint error = eglGetError();
+ if (error == EGL_BAD_ALLOC) {
+ if (tries) {
+ User::After(1000 * 250); // 250ms
+ continue;
+ }
+ }
+ qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", error);
+ } else {
+ break;
+ }
+ }
+#else
if (devType == QInternal::Widget)
surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props);
else
@@ -691,6 +722,7 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglPr
if (surf == EGL_NO_SURFACE) {
qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
}
+#endif
return surf;
}
#endif
diff --git a/src/gui/kernel/qcursor_win.cpp b/src/gui/kernel/qcursor_win.cpp
index cef83f5a1b..a68472c584 100644
--- a/src/gui/kernel/qcursor_win.cpp
+++ b/src/gui/kernel/qcursor_win.cpp
@@ -477,7 +477,7 @@ void QCursorData::update()
QPixmap pixmap = QApplicationPrivate::instance()->getPixmapCursor(cshape);
hcurs = create32BitCursor(pixmap, hx, hy);
}
- break;
+ return;
default:
qWarning("QCursor::update: Invalid cursor shape %d", cshape);
return;
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 0aa1dfa283..9b5a28326f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -2260,10 +2260,16 @@ void QWidgetPrivate::updateIsOpaque()
#endif
#ifdef Q_WS_S60
- if (q->windowType() == Qt::Dialog && q->testAttribute(Qt::WA_TranslucentBackground)
- && S60->avkonComponentsSupportTransparency) {
- setOpaque(false);
- return;
+ if (q->testAttribute(Qt::WA_TranslucentBackground)) {
+ if (q->windowType() & Qt::Dialog || q->windowType() & Qt::Popup) {
+ if (S60->avkonComponentsSupportTransparency) {
+ setOpaque(false);
+ return;
+ }
+ } else {
+ setOpaque(false);
+ return;
+ }
}
#endif
@@ -2283,11 +2289,16 @@ void QWidgetPrivate::updateIsOpaque()
}
if (q->isWindow() && !q->testAttribute(Qt::WA_NoSystemBackground)) {
+#ifdef Q_WS_S60
+ setOpaque(true);
+ return;
+#else
const QBrush &windowBrush = q->palette().brush(QPalette::Window);
if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) {
setOpaque(true);
return;
}
+#endif
}
setOpaque(false);
}
@@ -10948,11 +10959,14 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
}
break;
case Qt::WA_TranslucentBackground:
+#if defined(Q_OS_SYMBIAN)
+ setAttribute(Qt::WA_NoSystemBackground, on);
+#else
if (on) {
setAttribute(Qt::WA_NoSystemBackground);
d->updateIsTranslucent();
}
-
+#endif
break;
case Qt::WA_AcceptTouchEvents:
#if defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN)
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index aefffb6ceb..9ac94795d5 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -233,6 +233,7 @@ struct QTLWExtra {
uint inExpose : 1; // Prevents drawing recursion
uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency
uint forcedToRaster : 1;
+ uint noSystemRotationDisabled : 1;
#elif defined(Q_WS_QPA)
QPlatformWindow *platformWindow;
QPlatformWindowFormat platformWindowFormat;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index e06b625812..00661ae7e3 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -804,19 +804,12 @@ void QWidgetPrivate::setConstraints_sys()
void QWidgetPrivate::s60UpdateIsOpaque()
{
Q_Q(QWidget);
-
if (!q->testAttribute(Qt::WA_WState_Created))
return;
-
const bool writeAlpha = extraData()->nativePaintMode == QWExtra::BlitWriteAlpha;
- if (!q->testAttribute(Qt::WA_TranslucentBackground) && !writeAlpha)
- return;
const bool requireAlphaChannel = !isOpaque || writeAlpha;
-
createTLExtra();
-
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
-
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces
&& !extra->topextra->forcedToRaster) {
@@ -825,25 +818,47 @@ void QWidgetPrivate::s60UpdateIsOpaque()
return;
}
#endif
+ const bool recreateBackingStore = extra->topextra->backingStore.data() && (
+ QApplicationPrivate::graphics_system_name == QLatin1String("openvg") ||
+ QApplicationPrivate::graphics_system_name == QLatin1String("opengl")
+ );
if (requireAlphaChannel) {
- const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone) {
+ window->SetRequiredDisplayMode(EColor16MA);
+ if (window->SetTransparencyAlphaChannel() == KErrNone)
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
- extra->topextra->nativeWindowTransparencyEnabled = 1;
- if (extra->topextra->backingStore.data() && (
- QApplicationPrivate::graphics_system_name == QLatin1String("openvg")
- || QApplicationPrivate::graphics_system_name == QLatin1String("opengl"))) {
- // Semi-transparent EGL surfaces aren't supported. We need to
- // recreate backing store to get translucent surface (raster surface).
- extra->topextra->backingStore.create(q);
- extra->topextra->backingStore.registerWidget(q);
- // FixNativeOrientation() will not work without an EGL surface.
+ } else {
+ if (recreateBackingStore) {
+ // Clear the UI surface to ensure that the EGL surface content is visible
+ CWsScreenDevice *screenDevice = S60->screenDevice(q);
+ QScopedPointer<CWindowGc> gc(new CWindowGc(screenDevice));
+ const int err = gc->Construct();
+ if (!err) {
+ gc->Activate(*window);
+ window->BeginRedraw();
+ gc->SetDrawMode(CWindowGc::EDrawModeWriteAlpha);
+ gc->SetBrushColor(TRgb(0, 0, 0, 0));
+ gc->Clear(TRect(0, 0, q->width(), q->height()));
+ window->EndRedraw();
+ }
+ }
+ if (extra->topextra->nativeWindowTransparencyEnabled)
+ window->SetTransparentRegion(TRegionFix<1>());
+ }
+ extra->topextra->nativeWindowTransparencyEnabled = requireAlphaChannel;
+ if (recreateBackingStore) {
+ extra->topextra->backingStore.create(q);
+ extra->topextra->backingStore.registerWidget(q);
+ bool noSystemRotationDisabled = false;
+ if (requireAlphaChannel) {
+ if (q->testAttribute(Qt::WA_SymbianNoSystemRotation)) {
+ // FixNativeOrientation() will not work without an EGL surface
q->setAttribute(Qt::WA_SymbianNoSystemRotation, false);
+ noSystemRotationDisabled = true;
}
+ } else {
+ q->setAttribute(Qt::WA_SymbianNoSystemRotation, extra->topextra->noSystemRotationDisabled);
}
- } else if (extra->topextra->nativeWindowTransparencyEnabled) {
- window->SetTransparentRegion(TRegionFix<1>());
- extra->topextra->nativeWindowTransparencyEnabled = 0;
+ extra->topextra->noSystemRotationDisabled = noSystemRotationDisabled;
}
}
@@ -1004,6 +1019,7 @@ void QWidgetPrivate::createTLSysExtra()
extra->topextra->inExpose = 0;
extra->topextra->nativeWindowTransparencyEnabled = 0;
extra->topextra->forcedToRaster = 0;
+ extra->topextra->noSystemRotationDisabled = 0;
}
void QWidgetPrivate::deleteTLSysExtra()
diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp
index 4469704668..32e040fdc8 100644
--- a/src/gui/painting/qgraphicssystemex_symbian.cpp
+++ b/src/gui/painting/qgraphicssystemex_symbian.cpp
@@ -46,31 +46,108 @@
#include <e32property.h>
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+#include "private/qegl_p.h"
+#endif
+
QT_BEGIN_NAMESPACE
static bool bcm2727Initialized = false;
static bool bcm2727 = false;
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
+#define EGL_PROF_TOTAL_MEMORY_NOK 0x3070
+#endif
+
+// Detect if Qt is running on BCM2727 chip.
+// BCM2727 is a special case on Symbian because
+// it has only 32MB GPU memory which exposes
+// significant limitations to hw accelerated UI.
bool QSymbianGraphicsSystemEx::hasBCM2727()
{
if (bcm2727Initialized)
return bcm2727;
- const TUid KIvePropertyCat = {0x2726beef};
- enum TIvePropertyChipType {
- EVCBCM2727B1 = 0x00000000,
- EVCBCM2763A0 = 0x04000100,
- EVCBCM2763B0 = 0x04000102,
- EVCBCM2763C0 = 0x04000103,
- EVCBCM2763C1 = 0x04000104,
- EVCBCMUnknown = 0x7fffffff
- };
-
- TInt chipType = EVCBCMUnknown;
- if (RProperty::Get(KIvePropertyCat, 0, chipType) == KErrNone) {
- if (chipType == EVCBCM2727B1)
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+ EGLDisplay display = QEgl::display();
+#if 1
+ // Hacky but fast ~0ms.
+ const char* vendor = eglQueryString(display, EGL_VENDOR);
+ if (strstr(vendor, "Broadcom")) {
+ const TUid KIvePropertyCat = {0x2726beef};
+ enum TIvePropertyChipType {
+ EVCBCM2727B1 = 0x00000000,
+ EVCBCM2763A0 = 0x04000100,
+ EVCBCM2763B0 = 0x04000102,
+ EVCBCM2763C0 = 0x04000103,
+ EVCBCM2763C1 = 0x04000104,
+ EVCBCMUnknown = 0x7fffffff
+ };
+
+ // Broadcom driver publishes KIvePropertyCat PS key on
+ // devices which are running on BCM2727 chip and post Anna Symbian.
+ TInt chipType = EVCBCMUnknown;
+ if (RProperty::Get(KIvePropertyCat, 0, chipType) == KErrNone) {
+ if (chipType == EVCBCM2727B1)
+ bcm2727 = true;
+ } else if (QSysInfo::symbianVersion() <= QSysInfo::SV_SF_3) {
+ // Device is running on Symbian Anna or older Symbian^3 in which
+ // KIvePropertyCat is not published. These ones are always 32MB devices.
+ bcm2727 = true;
+ } else {
+ // We have some other Broadcom chip on post Anna Symbian.
+ // Should have > 32MB GPU memory.
+ }
+ }
+#else
+ // Fool proof but takes 15-20ms and we don't want this delay on app startup...
+
+ // All devices with <= 32MB GPU memory should be
+ // dealed in similar manner to BCM2727
+ // So let's query max GPU memory amount.
+ NOK_resource_profiling eglQueryProfilingData = (NOK_resource_profiling)eglGetProcAddress("eglQueryProfilingDataNOK");
+ if (eglQueryProfilingData) {
+ EGLint dataCount;
+ eglQueryProfilingData(display,
+ EGL_PROF_QUERY_GLOBAL_BIT_NOK |
+ EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+ NULL,
+ 0,
+ (EGLint*)&dataCount);
+
+ // Allocate room for the profiling data
+ EGLint* profData = (EGLint*)malloc(dataCount * sizeof(EGLint));
+ memset(profData,0,dataCount * sizeof(EGLint));
+
+ // Retrieve the profiling data
+ eglQueryProfilingData(display,
+ EGL_PROF_QUERY_GLOBAL_BIT_NOK |
+ EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+ profData,
+ dataCount,
+ (EGLint*)&dataCount);
+
+ int totalMemory;
+ EGLint i = 0;
+ while (profData && i < dataCount) {
+ switch (profData[i++]) {
+ case EGL_PROF_TOTAL_MEMORY_NOK:
+ totalMemory = profData[i++];
+ break;
+ default:
+ i++;
+ }
+ }
+
+ // ok, hasBCM2727() naming is a bit misleading but Qt must
+ // behave the same on all chips like BCM2727 (<= 32MB GPU memory)
+ // and our code (and others) are already using this function.
+ if (totalMemory <= 33554432)
bcm2727 = true;
}
+#endif
+#endif // Q_SYMBIAN_SUPPORTS_SURFACES
bcm2727Initialized = true;
@@ -80,7 +157,9 @@ bool QSymbianGraphicsSystemEx::hasBCM2727()
void QSymbianGraphicsSystemEx::releaseCachedGpuResources()
{
// Do nothing here
- // This is implemented in graphics system specific plugin
+
+ // This virtual function should be implemented in graphics system specific
+ // plugin
}
void QSymbianGraphicsSystemEx::releaseAllGpuResources()
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index d58da37974..0af2e59c54 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -445,6 +445,8 @@ void QLineControl::moveCursor(int pos, bool mark)
void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
{
int priorState = 0;
+ int originalSelectionStart = m_selstart;
+ int originalSelectionEnd = m_selend;
bool isGettingInput = !event->commitString().isEmpty()
|| event->preeditString() != preeditAreaText()
|| event->replacementLength() > 0;
@@ -523,6 +525,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
}
m_textLayout.setAdditionalFormats(formats);
updateDisplayText(/*force*/ true);
+ if (originalSelectionStart != m_selstart || originalSelectionEnd != m_selend)
+ emit selectionChanged();
if (cursorPositionChanged)
emitCursorPositionChanged();
else if (m_preeditCursor != oldPreeditCursor)
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 1a02200572..6173b39ff9 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -891,7 +891,7 @@ bool QHttpNetworkReplyPrivate::expectContent()
|| statusCode == 204 || statusCode == 304)
return false;
if (request.operation() == QHttpNetworkRequest::Head)
- return !shouldEmitSignals();
+ return false; // no body expected for HEAD request
qint64 expectedContentLength = contentLength();
if (expectedContentLength == 0)
return false;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 0b568d4d24..6f2daecdf0 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -471,6 +471,7 @@ bool QNetworkReplyImplPrivate::isCachingEnabled() const
void QNetworkReplyImplPrivate::setCachingEnabled(bool enable)
{
+ Q_Q(QNetworkReplyImpl);
if (!enable && !cacheEnabled)
return; // nothing to do
if (enable && cacheEnabled)
@@ -493,15 +494,27 @@ void QNetworkReplyImplPrivate::setCachingEnabled(bool enable)
networkCache()->remove(url);
cacheSaveDevice = 0;
cacheEnabled = false;
+ QObject::disconnect(networkCache(), SIGNAL(destroyed()), q, SLOT(_q_cacheDestroyed()));
}
}
+void QNetworkReplyImplPrivate::_q_cacheDestroyed()
+{
+ //destruction of cache invalidates cacheSaveDevice
+ cacheSaveDevice = 0;
+ cacheEnabled = false;
+}
+
void QNetworkReplyImplPrivate::completeCacheSave()
{
- if (cacheEnabled && errorCode != QNetworkReplyImpl::NoError) {
- networkCache()->remove(url);
- } else if (cacheEnabled && cacheSaveDevice) {
- networkCache()->insert(cacheSaveDevice);
+ Q_Q(QNetworkReplyImpl);
+ if (cacheEnabled) {
+ if (errorCode != QNetworkReplyImpl::NoError) {
+ networkCache()->remove(url);
+ } else if (cacheSaveDevice) {
+ networkCache()->insert(cacheSaveDevice);
+ }
+ QObject::disconnect(networkCache(), SIGNAL(destroyed()), q, SLOT(_q_cacheDestroyed()));
}
cacheSaveDevice = 0;
cacheEnabled = false;
@@ -561,6 +574,8 @@ void QNetworkReplyImplPrivate::initCacheSaveDevice()
networkCache()->remove(url);
cacheSaveDevice = 0;
cacheEnabled = false;
+ } else {
+ q->connect(networkCache(), SIGNAL(destroyed()), SLOT(_q_cacheDestroyed()));
}
}
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 089c87e693..286d8eaf5e 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -104,6 +104,7 @@ public:
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionConnected())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed())
#endif
+ Q_PRIVATE_SLOT(d_func(), void _q_cacheDestroyed())
};
class QNetworkReplyImplPrivate: public QNetworkReplyPrivate
@@ -140,6 +141,7 @@ public:
void _q_networkSessionConnected();
void _q_networkSessionFailed();
#endif
+ void _q_cacheDestroyed();
void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request,
QIODevice *outgoingData);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index cedccaa69b..423fa08a1f 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -103,6 +103,7 @@
#ifdef Q_OS_SYMBIAN
#include <private/qgltexturepool_p.h>
+#include <private/qeglcontext_p.h>
#endif
// #define QT_GL_CONTEXT_RESOURCE_DEBUG
@@ -3432,8 +3433,25 @@ const QGLContext* QGLContext::currentContext()
return 0;
#else
QGLThreadContext *threadContext = qgl_context_storage.localData();
- if (threadContext)
+ if (threadContext) {
+#ifdef Q_OS_SYMBIAN
+ // Query the current context and return null if it is different.
+ // This is needed to support mixed VG-GL rendering.
+ // QtOpenVG is free to make a QEglContext current at any time and
+ // QGLContext gets no notification that its underlying QEglContext is
+ // not current anymore. We query directly from EGL to be thread-safe.
+ // QEglContext does not store all the contexts per-thread.
+ if (threadContext->context) {
+ QEglContext *eglcontext = threadContext->context->d_func()->eglContext;
+ if (eglcontext) {
+ EGLContext ctx = eglcontext->context();
+ if (ctx != eglGetCurrentContext())
+ return 0;
+ }
+ }
+#endif
return threadContext->context;
+ }
return 0;
#endif //Q_WS_QPA
}