aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-05-06 09:38:48 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-05-06 09:38:48 +0000
commit1484039a77d86504901e82b18582d908648b8d35 (patch)
tree87ee62bf62ab78a2d677495a7f8ba614fb01bd8a /src
parent697cbf3474d32ebd4f7e22695223cdb8cdf44f35 (diff)
parent9b6d55ddf361f14c05c2965b29184a95e3c6a989 (diff)
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp5
-rw-r--r--src/qml/qml/qqmlextensioninterface.h2
-rw-r--r--src/quick/items/qquickanimatedimage.cpp24
-rw-r--r--src/quick/items/qquickanimatedimage_p_p.h3
-rw-r--r--src/quick/items/qquickdrag.cpp11
-rw-r--r--src/quick/items/qquickitem.cpp2
-rw-r--r--src/quick/items/qquickwindow.cpp6
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp10
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h6
9 files changed, 41 insertions, 28 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 92971e2298..4bc81e414a 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -984,10 +984,9 @@ ReturnedValue Runtime::callQmlScopeObjectProperty(ExecutionEngine *engine, int p
Scope scope(engine);
ScopedFunctionObject o(scope, getQmlScopeObjectProperty(engine, callData->thisObject, propertyIndex));
if (!o) {
- QString error = QStringLiteral("Property '%1' of object %2 is not a function").arg(propertyIndex).arg(callData->thisObject.toQStringNoThrow());
+ QString error = QStringLiteral("Property '%1' of scope object is not a function").arg(propertyIndex);
return engine->throwTypeError(error);
}
-
return o->call(callData);
}
@@ -996,7 +995,7 @@ ReturnedValue Runtime::callQmlContextObjectProperty(ExecutionEngine *engine, int
Scope scope(engine);
ScopedFunctionObject o(scope, getQmlContextObjectProperty(engine, callData->thisObject, propertyIndex));
if (!o) {
- QString error = QStringLiteral("Property '%1' of object %2 is not a function").arg(propertyIndex).arg(callData->thisObject.toQStringNoThrow());
+ QString error = QStringLiteral("Property '%1' of context object is not a function").arg(propertyIndex);
return engine->throwTypeError(error);
}
diff --git a/src/qml/qml/qqmlextensioninterface.h b/src/qml/qml/qqmlextensioninterface.h
index 73e41a3b80..ef56d5e312 100644
--- a/src/qml/qml/qqmlextensioninterface.h
+++ b/src/qml/qml/qqmlextensioninterface.h
@@ -66,7 +66,7 @@ public:
Q_DECLARE_INTERFACE(QQmlTypesExtensionInterface, "org.qt-project.Qt.QQmlTypesExtensionInterface/1.0")
-#define QQmlExtensionInterface_iid "org.qt-project.Qt.QQmlExtensionInterface"
+#define QQmlExtensionInterface_iid "org.qt-project.Qt.QQmlExtensionInterface/1.0"
Q_DECLARE_INTERFACE(QQmlExtensionInterface, QQmlExtensionInterface_iid)
diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp
index 3ae2512c98..ab5170cd65 100644
--- a/src/quick/items/qquickanimatedimage.cpp
+++ b/src/quick/items/qquickanimatedimage.cpp
@@ -300,8 +300,9 @@ void QQuickAnimatedImage::load()
d->status = Null;
emit statusChanged(d->status);
- if (sourceSize() != d->oldSourceSize) {
- d->oldSourceSize = sourceSize();
+ d->currentSourceSize = QSize(0, 0);
+ if (d->currentSourceSize != d->oldSourceSize) {
+ d->oldSourceSize = d->currentSourceSize;
emit sourceSizeChanged();
}
if (isPlaying() != d->oldPlaying)
@@ -372,8 +373,9 @@ void QQuickAnimatedImage::movieRequestFinished()
d->status = Error;
emit statusChanged(d->status);
- if (sourceSize() != d->oldSourceSize) {
- d->oldSourceSize = sourceSize();
+ d->currentSourceSize = QSize(0, 0);
+ if (d->currentSourceSize != d->oldSourceSize) {
+ d->oldSourceSize = d->currentSourceSize;
emit sourceSizeChanged();
}
if (isPlaying() != d->oldPlaying)
@@ -410,8 +412,14 @@ void QQuickAnimatedImage::movieRequestFinished()
if (isPlaying() != d->oldPlaying)
emit playingChanged();
- if (sourceSize() != d->oldSourceSize) {
- d->oldSourceSize = sourceSize();
+
+ if (d->_movie)
+ d->currentSourceSize = d->_movie->currentPixmap().size();
+ else
+ d->currentSourceSize = QSize(0, 0);
+
+ if (d->currentSourceSize != d->oldSourceSize) {
+ d->oldSourceSize = d->currentSourceSize;
emit sourceSizeChanged();
}
}
@@ -464,9 +472,7 @@ void QQuickAnimatedImage::onCacheChanged()
QSize QQuickAnimatedImage::sourceSize()
{
Q_D(QQuickAnimatedImage);
- if (!d->_movie)
- return QSize(0, 0);
- return QSize(d->_movie->currentPixmap().size());
+ return d->currentSourceSize;
}
void QQuickAnimatedImage::componentComplete()
diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h
index 9474254252..6d32f1071f 100644
--- a/src/quick/items/qquickanimatedimage_p_p.h
+++ b/src/quick/items/qquickanimatedimage_p_p.h
@@ -66,7 +66,7 @@ class QQuickAnimatedImagePrivate : public QQuickImagePrivate
public:
QQuickAnimatedImagePrivate()
- : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0), redirectCount(0), oldPlaying(false)
+ : playing(true), paused(false), preset_currentframe(0), _movie(0), reply(0), redirectCount(0), oldPlaying(false), currentSourceSize(0, 0)
{
}
@@ -80,6 +80,7 @@ public:
int redirectCount;
bool oldPlaying;
QMap<int, QQuickPixmap *> frameMap;
+ QSize currentSourceSize;
};
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index 126737418a..9a24d7a8a0 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -307,13 +307,14 @@ void QQuickDragAttached::setActive(bool active)
else if (active) {
if (d->dragType == QQuickDrag::Internal) {
d->start(d->supportedActions);
- }
- else if (d->dragType == QQuickDrag::Automatic) {
- // There are different semantics than start() since startDrag()
- // may be called after an internal drag is already started.
+ } else {
d->active = true;
emit activeChanged();
- d->startDrag(d->supportedActions);
+ if (d->dragType == QQuickDrag::Automatic) {
+ // There are different semantics than start() since startDrag()
+ // may be called after an internal drag is already started.
+ d->startDrag(d->supportedActions);
+ }
}
}
else
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index ee96e346c2..38d070831c 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1630,7 +1630,7 @@ void QQuickItemPrivate::setLayoutMirror(bool mirror)
*/
/*!
- \qmlproperty enumeration QtQuick::EnterKey::type
+ \qmlattachedproperty enumeration QtQuick::EnterKey::type
Holds the type of the Enter key.
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 54e4339f7e..b06cfe54cc 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -4040,6 +4040,12 @@ void QQuickWindow::resetOpenGLState()
*/
/*!
+ \qmlproperty Item Window::contentItem
+ \readonly
+ \brief The invisible root item of the scene.
+*/
+
+/*!
\qmlproperty Qt::ScreenOrientation Window::contentOrientation
This is a hint to the window manager in case it needs to display
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 0e77befe04..d91004fbee 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -496,11 +496,6 @@ void Updater::visitGeometryNode(Node *n)
if (e->batch)
renderer->invalidateBatchAndOverlappingRenderOrders(e->batch);
}
- if (n->dirtyState & QSGNode::DirtyMaterial) {
- Element *e = n->element();
- if (e->batch && e->batch->isMaterialCompatible(e) == BatchBreaksOnCompare)
- renderer->invalidateBatchAndOverlappingRenderOrders(e->batch);
- }
}
SHADOWNODE_TRAVERSE(n) visitNode(child);
@@ -1240,7 +1235,10 @@ void Renderer::nodeChanged(QSGNode *node, QSGNode::DirtyState state)
if (e->isMaterialBlended != blended) {
m_rebuild |= Renderer::FullRebuild;
e->isMaterialBlended = blended;
- } else if (!e->batch) {
+ } else if (e->batch) {
+ if (e->batch->isMaterialCompatible(e) == BatchBreaksOnCompare)
+ invalidateBatchAndOverlappingRenderOrders(e->batch);
+ } else {
m_rebuild |= Renderer::BuildBatches;
}
}
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index 5dbbc22870..8bf4a13af6 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -527,7 +527,7 @@ public:
float lastOpacity;
};
- ShaderManager(QSGRenderContext *ctx) : blitProgram(0), visualizeProgram(0), context(ctx) { }
+ ShaderManager(QSGRenderContext *ctx) : visualizeProgram(0), blitProgram(0), context(ctx) { }
~ShaderManager() {
qDeleteAll(rewrittenShaders);
qDeleteAll(stockShaders);
@@ -540,11 +540,13 @@ public:
Shader *prepareMaterial(QSGMaterial *material);
Shader *prepareMaterialNoRewrite(QSGMaterial *material);
+ QOpenGLShaderProgram *visualizeProgram;
+
+private:
QHash<QSGMaterialType *, Shader *> rewrittenShaders;
QHash<QSGMaterialType *, Shader *> stockShaders;
QOpenGLShaderProgram *blitProgram;
- QOpenGLShaderProgram *visualizeProgram;
QSGRenderContext *context;
};