diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:19:05 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-20 16:19:05 +0200 |
commit | 2402d3a303f712f4402cc258fcd7c8983227ea31 (patch) | |
tree | 3e79afdfd1e4268adecf4ad98bb867025048bd61 /src | |
parent | 1037a7f7123dcf9f7b48a6a74118f746ddcbf3d5 (diff) | |
parent | 5d4b006181d009e6245d5d38c7798603ddcab06a (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I5cc2cacd26004ba18f0c6214759f5e073b5c6cfb
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/ftw/qhashedstring.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcanvasitem.cpp | 8 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | 7 | ||||
-rw-r--r-- | src/quick/items/qquickimage.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultimagenode.cpp | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultimagenode_p.h | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrectanglenode.cpp | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultrectanglenode_p.h | 6 |
10 files changed, 33 insertions, 30 deletions
diff --git a/src/qml/qml/ftw/qhashedstring.cpp b/src/qml/qml/ftw/qhashedstring.cpp index 212a6757d0..1b7ad38ad1 100644 --- a/src/qml/qml/ftw/qhashedstring.cpp +++ b/src/qml/qml/ftw/qhashedstring.cpp @@ -156,7 +156,7 @@ bool QHashedString::compare(const QChar *lhs, const QChar *rhs, int length) if (a == b || !length) return true; - register union { + union { const quint16 *w; const quint32 *d; quintptr value; @@ -181,7 +181,7 @@ bool QHashedString::compare(const QChar *lhs, const QChar *rhs, int length) // both addresses are 4-bytes aligned // do a fast 32-bit comparison - register const quint32 *e = sa.d + (length >> 1); + const quint32 *e = sa.d + (length >> 1); for ( ; sa.d != e; ++sa.d, ++sb.d) { if (*sa.d != *sb.d) return false; @@ -191,7 +191,7 @@ bool QHashedString::compare(const QChar *lhs, const QChar *rhs, int length) return (length & 1) ? *sa.w == *sb.w : true; } else { // one of the addresses isn't 4-byte aligned but the other is - register const quint16 *e = sa.w + length; + const quint16 *e = sa.w + length; for ( ; sa.w != e; ++sa.w, ++sb.w) { if (*sa.w != *sb.w) return false; diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index a304365dfe..673fbfefbb 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1065,7 +1065,7 @@ QQmlImageProviderBase *QQmlEngine::imageProvider(const QString &providerId) cons { Q_D(const QQmlEngine); QMutexLocker locker(&d->mutex); - return d->imageProviders.value(providerId).data(); + return d->imageProviders.value(providerId.toLower()).data(); } /*! @@ -1077,7 +1077,7 @@ void QQmlEngine::removeImageProvider(const QString &providerId) { Q_D(QQmlEngine); QMutexLocker locker(&d->mutex); - d->imageProviders.take(providerId); + d->imageProviders.take(providerId.toLower()); } /*! diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 4144256a38..1b33680361 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -645,7 +645,7 @@ void QQuickCanvasItem::updatePolish() Q_D(QQuickCanvasItem); - if (d->context) + if (d->context && d->renderStrategy != QQuickCanvasItem::Cooperative) d->context->prepare(d->canvasSize.toSize(), d->tileSize, d->canvasWindow.toRect(), d->dirtyRect.toRect(), d->smooth, d->antialiasing); if (d->animationCallbacks.size() > 0 && isVisible()) { @@ -683,7 +683,7 @@ QSGNode *QQuickCanvasItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData { Q_D(QQuickCanvasItem); - if (!d->context) { + if (!d->context || d->canvasWindow.size().isEmpty()) { delete oldNode; return 0; } @@ -697,8 +697,10 @@ QSGNode *QQuickCanvasItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData else node->setFiltering(QSGTexture::Nearest); - if (d->renderStrategy == QQuickCanvasItem::Cooperative) + if (d->renderStrategy == QQuickCanvasItem::Cooperative) { + d->context->prepare(d->canvasSize.toSize(), d->tileSize, d->canvasWindow.toRect(), d->dirtyRect.toRect(), d->smooth, d->antialiasing); d->context->flush(); + } node->setTexture(d->context->texture()); node->markDirty(QSGNode::DirtyMaterial); diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index 237bd61c1b..d433efcb69 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -346,12 +346,9 @@ void QQuickContext2DCommandBuffer::replay(QPainter* p, QQuickContext2D::State& s case QQuickContext2D::ClearRect: { QPainter::CompositionMode cm = p->compositionMode(); - qreal alpha = p->opacity(); - p->setCompositionMode(QPainter::CompositionMode_Source); - p->setOpacity(0); - p->fillRect(takeRect(), QColor(qRgba(0, 0, 0, 0))); + p->setCompositionMode(QPainter::CompositionMode_Clear); + p->fillRect(takeRect(), Qt::white); p->setCompositionMode(cm); - p->setOpacity(alpha); break; } case QQuickContext2D::FillRect: diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 9403b7967e..6fe4b39974 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -233,6 +233,8 @@ void QQuickImagePrivate::setImage(const QImage &image) Image { width: 120; height: 120 fillMode: Image.Tile + horizontalAlignment: Image.AlignLeft + verticalAlignment: Image.AlignTop source: "qtlogo.png" } \endqml @@ -244,6 +246,7 @@ void QQuickImagePrivate::setImage(const QImage &image) Image { width: 120; height: 120 fillMode: Image.TileVertically + verticalAlignment: Image.AlignTop source: "qtlogo.png" } \endqml @@ -255,6 +258,7 @@ void QQuickImagePrivate::setImage(const QImage &image) Image { width: 120; height: 120 fillMode: Image.TileHorizontally + verticalAlignment: Image.AlignLeft source: "qtlogo.png" } \endqml @@ -460,7 +464,7 @@ qreal QQuickImage::paintedHeight() const \qmlproperty enumeration QtQuick2::Image::horizontalAlignment \qmlproperty enumeration QtQuick2::Image::verticalAlignment - Sets the horizontal and vertical alignment of the image. By default, the image is top-left aligned. + Sets the horizontal and vertical alignment of the image. By default, the image is center aligned. The valid values for \c horizontalAlignment are \c Image.AlignLeft, \c Image.AlignRight and \c Image.AlignHCenter. The valid values for \c verticalAlignment are \c Image.AlignTop, \c Image.AlignBottom diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 6d327b8d80..866d678412 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -286,8 +286,8 @@ void QSGContext::precompileMaterials() QSG_PRECOMPILE_MATERIAL(QSGFlatColorMaterial); QSG_PRECOMPILE_MATERIAL(QSGOpaqueTextureMaterial); QSG_PRECOMPILE_MATERIAL(QSGTextureMaterial); - QSG_PRECOMPILE_MATERIAL(SmoothTextureMaterial); - QSG_PRECOMPILE_MATERIAL(SmoothColorMaterial); + QSG_PRECOMPILE_MATERIAL(QSGSmoothTextureMaterial); + QSG_PRECOMPILE_MATERIAL(QSGSmoothColorMaterial); QSG_PRECOMPILE_MATERIAL(QSGDistanceFieldTextMaterial); } } diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp index cadd18e833..aed69913fa 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultimagenode.cpp @@ -87,24 +87,24 @@ protected: }; -SmoothTextureMaterial::SmoothTextureMaterial() +QSGSmoothTextureMaterial::QSGSmoothTextureMaterial() { setFlag(RequiresFullMatrixExceptTranslate, true); setFlag(Blending, true); } -void SmoothTextureMaterial::setTexture(QSGTexture *texture) +void QSGSmoothTextureMaterial::setTexture(QSGTexture *texture) { m_texture = texture; } -QSGMaterialType *SmoothTextureMaterial::type() const +QSGMaterialType *QSGSmoothTextureMaterial::type() const { static QSGMaterialType type; return &type; } -QSGMaterialShader *SmoothTextureMaterial::createShader() const +QSGMaterialShader *QSGSmoothTextureMaterial::createShader() const { return new SmoothTextureMaterialShader; } diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h index d7be5f7c14..723943fd71 100644 --- a/src/quick/scenegraph/qsgdefaultimagenode_p.h +++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h @@ -48,10 +48,10 @@ QT_BEGIN_NAMESPACE -class SmoothTextureMaterial : public QSGTextureMaterial +class Q_QUICK_PRIVATE_EXPORT QSGSmoothTextureMaterial : public QSGTextureMaterial { public: - SmoothTextureMaterial(); + QSGSmoothTextureMaterial(); void setTexture(QSGTexture *texture); @@ -90,7 +90,7 @@ private: QSGOpaqueTextureMaterial m_material; QSGTextureMaterial m_materialO; - SmoothTextureMaterial m_smoothMaterial; + QSGSmoothTextureMaterial m_smoothMaterial; uint m_antialiasing : 1; uint m_mirror : 1; diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp index f642ca8d16..76fbbb4209 100644 --- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp +++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp @@ -211,24 +211,24 @@ const char *SmoothColorMaterialShader::fragmentShader() const "}"; } -SmoothColorMaterial::SmoothColorMaterial() +QSGSmoothColorMaterial::QSGSmoothColorMaterial() { setFlag(RequiresFullMatrixExceptTranslate, true); setFlag(Blending, true); } -int SmoothColorMaterial::compare(const QSGMaterial *) const +int QSGSmoothColorMaterial::compare(const QSGMaterial *) const { return 0; } -QSGMaterialType *SmoothColorMaterial::type() const +QSGMaterialType *QSGSmoothColorMaterial::type() const { static QSGMaterialType type; return &type; } -QSGMaterialShader *SmoothColorMaterial::createShader() const +QSGMaterialShader *QSGSmoothColorMaterial::createShader() const { return new SmoothColorMaterialShader; } diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h index 9ca8a96de5..1994e015e9 100644 --- a/src/quick/scenegraph/qsgdefaultrectanglenode_p.h +++ b/src/quick/scenegraph/qsgdefaultrectanglenode_p.h @@ -51,10 +51,10 @@ QT_BEGIN_NAMESPACE class QSGContext; -class SmoothColorMaterial : public QSGMaterial +class Q_QUICK_PRIVATE_EXPORT QSGSmoothColorMaterial : public QSGMaterial { public: - SmoothColorMaterial(); + QSGSmoothColorMaterial(); int compare(const QSGMaterial *other) const; @@ -83,7 +83,7 @@ private: void updateGradientTexture(); QSGVertexColorMaterial m_material; - SmoothColorMaterial m_smoothMaterial; + QSGSmoothColorMaterial m_smoothMaterial; QRectF m_rect; QGradientStops m_gradient_stops; |