Re-apply "Support mirroring the source rectangle of ShaderEffectSource."
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>
Thu, 19 May 2011 08:26:55 +0000 (10:26 +0200)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>
Thu, 19 May 2011 08:26:55 +0000 (10:26 +0200)
This reverts commit 616c7e768f3d88f6b8be6af72290769e99500e72.

src/declarative/items/qsgshadereffectsource.cpp
src/declarative/qml/qdeclarativeengine.cpp

index 217b0e6..e2c50bb 100644 (file)
@@ -780,12 +780,12 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod
 
     tex->setLive(m_live);
     tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
-    QRectF sourceRect = m_sourceRect.isEmpty()
+    QRectF sourceRect = m_sourceRect.isNull()
                       ? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
                       : m_sourceRect;
     tex->setRect(sourceRect);
     QSize textureSize = m_textureSize.isEmpty()
-                      ? QSize(qCeil(sourceRect.width()), qCeil(sourceRect.height()))
+                      ? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
                       : m_textureSize;
     tex->setSize(textureSize);
     tex->setRecursive(m_recursive);
index 0018841..eb2974f 100644 (file)
@@ -1740,9 +1740,6 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
     qsreal w = ctxt->argument(2).toNumber();
     qsreal h = ctxt->argument(3).toNumber();
 
-    if (w < 0 || h < 0)
-        return engine->nullValue();
-
     return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
 }