diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-06-02 01:59:28 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-06-02 01:59:28 (GMT) |
commit | 7c963ed70317191bb9f6eec5e8cc79fc985bf00b (patch) | |
tree | dcb6b4697e0f5a12874d053d848bf4965616efef | |
parent | c968390815e2bd578460d1a22a86ded10f373610 (diff) | |
parent | 02a8ba7ce8e5ca07ed8e3e83f10a18acd6e38a10 (diff) | |
download | Qt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.zip Qt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.tar.gz Qt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
src/declarative/util/qfxperf.cpp
-rw-r--r-- | src/declarative/canvas/qsimplecanvas_opengl.cpp | 70 | ||||
-rw-r--r-- | src/declarative/debugger/qmldebugserver.cpp | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxpath.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 18 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qfxperf.cpp | 30 | ||||
-rw-r--r-- | src/declarative/util/qfxperf.h | 18 | ||||
-rw-r--r-- | src/gui/math3d/qmatrix4x4.cpp | 110 | ||||
-rw-r--r-- | src/gui/math3d/qmatrix4x4.h | 19 |
12 files changed, 179 insertions, 100 deletions
diff --git a/src/declarative/canvas/qsimplecanvas_opengl.cpp b/src/declarative/canvas/qsimplecanvas_opengl.cpp index 72f8324..ec809ff 100644 --- a/src/declarative/canvas/qsimplecanvas_opengl.cpp +++ b/src/declarative/canvas/qsimplecanvas_opengl.cpp @@ -224,39 +224,47 @@ void QSimpleCanvasItemPrivate::paintChild(const GLPaintParameters ¶ms, void QSimpleCanvasItemPrivate::setupChildState(QSimpleCanvasItem *child) { - qreal visible = child->visible(); - child->d_func()->data()->activeOpacity = data()->activeOpacity; - if (visible != 1) - child->d_func()->data()->activeOpacity *= visible; + QSimpleCanvasItemData *const myData = data(); + QSimpleCanvasItemPrivate *const childPrivate = child->d_func(); + QSimpleCanvasItemData *const childData = childPrivate->data(); - if (child->d_func()->data()->activeOpacity != 0) { + childData->activeOpacity = myData->activeOpacity; + if (childData->visible != 1) + childData->activeOpacity *= childData->visible; + + if (childData->activeOpacity != 0) { // Calculate child's transform - qreal x = child->x(); - qreal y = child->y(); - qreal scale = child->scale(); - QSimpleCanvasItem::Flip flip = child->flip(); - - QSimpleCanvas::Matrix &am = child->d_func()->data()->transformActive; - am = data()->transformActive; - if (x != 0 || y != 0) + const qreal x = childData->x; + const qreal y = childData->y; + const qreal scale = childPrivate->scale; + QSimpleCanvasItem::Flip flip = childData->flip; + + QSimpleCanvas::Matrix &am = childData->transformActive; + am = myData->transformActive; + if (x != 0. || y != 0.) am.translate(x, y); - if (scale != 1) { - QPointF to = child->d_func()->transformOrigin(); - if (to.x() != 0. || to.y() != 0.) + + if (scale != 1.) { + QPointF to = childPrivate->transformOrigin(); + bool translate = (to.x() != 0. || to.y() != 0.); + if (translate) am.translate(to.x(), to.y()); am.scale(scale, scale); - if (to.x() != 0. || to.y() != 0.) + if (translate) am.translate(-to.x(), -to.y()); } - if (child->d_func()->data()->transformUser) - am *= *child->d_func()->data()->transformUser; + + if (childData->transformUser) + am *= *childData->transformUser; + if (flip) { QRectF br = child->boundingRect(); am.translate(br.width() / 2., br.height() / 2); am.rotate(180, (flip & QSimpleCanvasItem::VerticalFlip)?1:0, (flip & QSimpleCanvasItem::HorizontalFlip)?1:0, 0); am.translate(-br.width() / 2., -br.height() / 2); } - child->d_func()->data()->transformValid = true; + + childData->transformValid = true; } } @@ -264,20 +272,30 @@ QRectF QSimpleCanvasItemPrivate::setupPainting(int version, const QRect &boundin { Q_Q(QSimpleCanvasItem); - QRectF filteredBoundRect = q->boundingRect(); - if (filter) - filteredBoundRect = filter->itemBoundingRect(filteredBoundRect); - QRectF rv = data()->transformActive.mapRect(filteredBoundRect); + bool hasContents = options & QSimpleCanvasItem::HasContents; + + QSimpleCanvasItemData *myData = data(); + + QRectF rv; + if (hasContents) { + QRectF filteredBoundRect = q->boundingRect(); + if (filter) + filteredBoundRect = filter->itemBoundingRect(filteredBoundRect); + const QMatrix4x4 &active = myData->transformActive; + + rv = active.mapRect(filteredBoundRect); + } for (int ii = 0; ii < children.count(); ++ii) { QSimpleCanvasItem *child = children.at(ii); setupChildState(child); - if (child->d_func()->data()->activeOpacity != 0) + QSimpleCanvasItemData *childData = child->d_func()->data(); + if (childData->activeOpacity != 0) rv |= child->d_func()->setupPainting(version, bounding); } - data()->lastPaintRect = rv; + myData->lastPaintRect = rv; return rv; } diff --git a/src/declarative/debugger/qmldebugserver.cpp b/src/declarative/debugger/qmldebugserver.cpp index d52884e..23e59e0 100644 --- a/src/declarative/debugger/qmldebugserver.cpp +++ b/src/declarative/debugger/qmldebugserver.cpp @@ -283,6 +283,7 @@ void QmlDebugServerPlugin::sendMessage(const QByteArray &message) QPacket pack; pack << d->name << message; d->server->d_func()->protocol->send(pack); + d->server->d_func()->connection->flush(); } void QmlDebugServerPlugin::enabledChanged(bool) diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp index 5deaaa5..be731b1 100644 --- a/src/declarative/fx/qfxpath.cpp +++ b/src/declarative/fx/qfxpath.cpp @@ -357,7 +357,7 @@ void QFxPath::createPointCache() const { Q_D(const QFxPath); #ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::PathCache> pc; + QFxPerfTimer<QFxPerf::QFxPathViewPathCache> pc; #endif qreal pathLength = d->_path.length(); const int points = int(pathLength*2); diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 3029934..46695b7 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -470,7 +470,7 @@ bool QmlCompiler::compile(QmlEngine *engine, QmlCompiledComponent *out) { #ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::Compile> pc; + QFxPerfTimer<QFxPerf::Compilation> pc; #endif exceptions.clear(); diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 24b5dd2..78137e8 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -458,9 +458,6 @@ QObject *QmlComponent::beginCreate(QmlContext *context) return 0; } -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::CreateComponent> perf; -#endif if (!d->engine->d_func()->rootComponent) d->engine->d_func()->rootComponent = this; diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c67c220..18f28ed 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1275,9 +1275,6 @@ QmlContextScriptClass::queryProperty(const QScriptValue &object, QueryFlags flags, uint *id) { Q_UNUSED(flags); -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ContextQuery> perf; -#endif QmlContext *bindContext = static_cast<QmlContext*>(object.data().toQObject()); QueryFlags rv = 0; @@ -1308,9 +1305,6 @@ QScriptValue QmlContextScriptClass::property(const QScriptValue &object, const QScriptString &name, uint id) { -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ContextProperty> perf; -#endif QmlContext *bindContext = static_cast<QmlContext*>(object.data().toQObject()); @@ -1369,9 +1363,6 @@ void QmlContextScriptClass::setProperty(QScriptValue &object, { Q_UNUSED(name); -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ObjectSetProperty> perf; -#endif QmlContext *bindContext = static_cast<QmlContext*>(object.data().toQObject()); @@ -1422,9 +1413,6 @@ QScriptClass::QueryFlags QmlObjectScriptClass::queryProperty(const QScriptValue QueryFlags flags, uint *id) { Q_UNUSED(flags); -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ObjectQuery> perf; -#endif QObject *obj = object.data().toQObject(); QueryFlags rv = 0; QString propName = name.toString(); @@ -1443,9 +1431,6 @@ QScriptValue QmlObjectScriptClass::property(const QScriptValue &object, const QScriptString &name, uint id) { -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ObjectProperty> perf; -#endif QObject *obj = object.data().toQObject(); #ifdef PROPERTY_DEBUG @@ -1472,9 +1457,6 @@ void QmlObjectScriptClass::setProperty(QScriptValue &object, { Q_UNUSED(name); -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::ObjectSetProperty> perf; -#endif QObject *obj = object.data().toQObject(); #ifdef PROPERTY_DEBUG diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 3aa4f1d..4f39ebc 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -196,10 +196,6 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name) QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext *ctxt) : d(new QmlMetaPropertyPrivate) { -#ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::MetaProperty> perf; -#endif - d->context = ctxt; initProperty(obj, name); } diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index e68afcc..c85524f 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -201,7 +201,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in #ifdef Q_ENABLE_PERFORMANCE_LOG - QFxPerfTimer<QFxPerf::CompileRun> cr; + QFxPerfTimer<QFxPerf::VMEExecution> cr; #endif QmlEnginePrivate::SimpleList<QmlBindableValue> bindValues; QmlEnginePrivate::SimpleList<QmlParserStatus> parserStatus; diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp index 9b0e9b7..e4f0c53 100644 --- a/src/declarative/util/qfxperf.cpp +++ b/src/declarative/util/qfxperf.cpp @@ -44,32 +44,24 @@ QT_BEGIN_NAMESPACE Q_DEFINE_PERFORMANCE_LOG(QFxPerf, "QFx") { - Q_DEFINE_PERFORMANCE_METRIC(QmlParsing, "QML Parsing") - Q_DEFINE_PERFORMANCE_METRIC(Compile, "QML Compilation") - Q_DEFINE_PERFORMANCE_METRIC(CompileRun, "QML Compilation Run") - Q_DEFINE_PERFORMANCE_METRIC(CreateComponent, "Component creation") + Q_DEFINE_PERFORMANCE_METRIC(QmlParsing, "Compilation: QML Parsing") + Q_DEFINE_PERFORMANCE_METRIC(Compilation, " QML Compilation") + Q_DEFINE_PERFORMANCE_METRIC(VMEExecution, "Execution: QML VME Execution") Q_DEFINE_PERFORMANCE_METRIC(BindInit, "BindValue Initialization") - Q_DEFINE_PERFORMANCE_METRIC(BindCompile, "BindValue compile") Q_DEFINE_PERFORMANCE_METRIC(BindValue, "BindValue execution") Q_DEFINE_PERFORMANCE_METRIC(BindValueSSE, "BindValue execution SSE") Q_DEFINE_PERFORMANCE_METRIC(BindValueQt, "BindValue execution QtScript") - Q_DEFINE_PERFORMANCE_METRIC(ContextQuery, "QtScript: Query Context") - Q_DEFINE_PERFORMANCE_METRIC(ContextProperty, "QtScript: Context Property") - Q_DEFINE_PERFORMANCE_METRIC(ObjectQuery, "QtScript: Query Object") - Q_DEFINE_PERFORMANCE_METRIC(ObjectProperty, "QtScript: Object Property") - Q_DEFINE_PERFORMANCE_METRIC(ObjectSetProperty, "QtScript: Set Object Property") Q_DEFINE_PERFORMANCE_METRIC(BindableValueUpdate, "QmlBindableValue::update") Q_DEFINE_PERFORMANCE_METRIC(PixmapLoad, "Pixmap loading") - Q_DEFINE_PERFORMANCE_METRIC(MetaProperty, "Meta property resolution") - Q_DEFINE_PERFORMANCE_METRIC(PathCache, "Path cache") - Q_DEFINE_PERFORMANCE_METRIC(CreateParticle, "Particle creation") Q_DEFINE_PERFORMANCE_METRIC(FontDatabase, "Font database creation") - Q_DEFINE_PERFORMANCE_METRIC(ItemComponentComplete, "QFxItem::componentComplete") - Q_DEFINE_PERFORMANCE_METRIC(ImageComponentComplete, "QFxImage::componentComplete") - Q_DEFINE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete, "QFxComponentInstance::componentComplete") - Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, "QFxBaseLayout::componentComplete") - Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, "QFxText::componentComplete") - Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, "QFxText::setText") + Q_DEFINE_PERFORMANCE_METRIC(QFxPathViewPathCache, "FX Items: QFxPathView: Path cache") + Q_DEFINE_PERFORMANCE_METRIC(CreateParticle, " QFxParticles: Particle creation") + Q_DEFINE_PERFORMANCE_METRIC(ItemComponentComplete, " QFxItem::componentComplete") + Q_DEFINE_PERFORMANCE_METRIC(ImageComponentComplete, " QFxImage::componentComplete") + Q_DEFINE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete, " QFxComponentInstance::componentComplete") + Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, " QFxBaseLayout::componentComplete") + Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, " QFxText::componentComplete") + Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, " QFxText::setText") Q_DEFINE_PERFORMANCE_METRIC(AddScript, "QmlScript::addScriptToEngine") } QT_END_NAMESPACE diff --git a/src/declarative/util/qfxperf.h b/src/declarative/util/qfxperf.h index 23de8b5..9fcf1d6 100644 --- a/src/declarative/util/qfxperf.h +++ b/src/declarative/util/qfxperf.h @@ -51,25 +51,19 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) Q_DECLARE_PERFORMANCE_LOG(QFxPerf) { Q_DECLARE_PERFORMANCE_METRIC(QmlParsing) - Q_DECLARE_PERFORMANCE_METRIC(Compile) - Q_DECLARE_PERFORMANCE_METRIC(CompileRun) - Q_DECLARE_PERFORMANCE_METRIC(CreateComponent) + + Q_DECLARE_PERFORMANCE_METRIC(Compilation) + Q_DECLARE_PERFORMANCE_METRIC(VMEExecution) + Q_DECLARE_PERFORMANCE_METRIC(BindInit) - Q_DECLARE_PERFORMANCE_METRIC(BindCompile) Q_DECLARE_PERFORMANCE_METRIC(BindValue) Q_DECLARE_PERFORMANCE_METRIC(BindValueSSE) Q_DECLARE_PERFORMANCE_METRIC(BindValueQt) - Q_DECLARE_PERFORMANCE_METRIC(ContextQuery) - Q_DECLARE_PERFORMANCE_METRIC(ContextProperty) - Q_DECLARE_PERFORMANCE_METRIC(ObjectQuery) - Q_DECLARE_PERFORMANCE_METRIC(ObjectProperty) - Q_DECLARE_PERFORMANCE_METRIC(ObjectSetProperty) Q_DECLARE_PERFORMANCE_METRIC(BindableValueUpdate) Q_DECLARE_PERFORMANCE_METRIC(PixmapLoad) - Q_DECLARE_PERFORMANCE_METRIC(MetaProperty) - Q_DECLARE_PERFORMANCE_METRIC(PathCache) - Q_DECLARE_PERFORMANCE_METRIC(CreateParticle) Q_DECLARE_PERFORMANCE_METRIC(FontDatabase) + Q_DECLARE_PERFORMANCE_METRIC(QFxPathViewPathCache) + Q_DECLARE_PERFORMANCE_METRIC(CreateParticle) Q_DECLARE_PERFORMANCE_METRIC(ItemComponentComplete) Q_DECLARE_PERFORMANCE_METRIC(ImageComponentComplete) Q_DECLARE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete) diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp index a8dabf3..fd4f69a 100644 --- a/src/gui/math3d/qmatrix4x4.cpp +++ b/src/gui/math3d/qmatrix4x4.cpp @@ -740,6 +740,43 @@ QMatrix4x4& QMatrix4x4::scale(const QVector3D& vector) \overload Multiplies this matrix by another that scales coordinates by the + components \a x, and \a y. Returns this matrix. + + \sa translate(), rotate() +*/ +QMatrix4x4& QMatrix4x4::scale(qreal x, qreal y) +{ + float vx(x); + float vy(y); + if (flagBits == Identity) { + m[0][0] = vx; + m[1][1] = vy; + flagBits = Scale; + } else if (flagBits == Scale || flagBits == (Scale | Translation)) { + m[0][0] *= vx; + m[1][1] *= vy; + } else if (flagBits == Translation) { + m[0][0] = vx; + m[1][1] = vy; + flagBits |= Scale; + } else { + m[0][0] *= vx; + m[0][1] *= vx; + m[0][2] *= vx; + m[0][3] *= vx; + m[1][0] *= vy; + m[1][1] *= vy; + m[1][2] *= vy; + m[1][3] *= vy; + flagBits = General; + } + return *this; +} + +/*! + \overload + + Multiplies this matrix by another that scales coordinates by the components \a x, \a y, and \a z. Returns this matrix. \sa translate(), rotate() @@ -872,6 +909,46 @@ QMatrix4x4& QMatrix4x4::translate(const QVector3D& vector) \overload Multiplies this matrix by another that translates coordinates + by the components \a x, and \a y. Returns this matrix. + + \sa scale(), rotate() +*/ +QMatrix4x4& QMatrix4x4::translate(qreal x, qreal y) +{ + float vx(x); + float vy(y); + if (flagBits == Identity) { + m[3][0] = vx; + m[3][1] = vy; + flagBits = Translation; + } else if (flagBits == Translation) { + m[3][0] += vx; + m[3][1] += vy; + } else if (flagBits == Scale) { + m[3][0] = m[0][0] * vx; + m[3][1] = m[1][1] * vy; + m[3][2] = 0.; + flagBits |= Translation; + } else if (flagBits == (Scale | Translation)) { + m[3][0] += m[0][0] * vx; + m[3][1] += m[1][1] * vy; + } else { + m[3][0] += m[0][0] * vx + m[1][0] * vy; + m[3][1] += m[0][1] * vx + m[1][1] * vy; + m[3][2] += m[0][2] * vx + m[1][2] * vy; + m[3][3] += m[0][3] * vx + m[1][3] * vy; + if (flagBits == Rotation) + flagBits |= Translation; + else if (flagBits != (Rotation | Translation)) + flagBits = General; + } + return *this; +} + +/*! + \overload + + Multiplies this matrix by another that translates coordinates by the components \a x, \a y, and \a z. Returns this matrix. \sa scale(), rotate() @@ -1431,6 +1508,39 @@ QTransform QMatrix4x4::toTransform() const \sa map() */ +QRectF QMatrix4x4::mapRect(const QRectF& rect) const +{ + if (flagBits & Translation) { + if (flagBits & Scale) { + qreal x = rect.x() * m[0][0] + m[3][0]; + qreal y = rect.y() * m[1][1] + m[3][1]; + qreal w = rect.width() * m[0][0]; + qreal h = rect.height() * m[1][1]; + if (w < 0) { + w = -w; + x -= w; + } + if (h < 0) { + h = -h; + y -= h; + } + return QRectF(x, y, w, h); + } else { + return rect.translated(m[3][0], m[3][1]); + } + } + + QPointF tl = map(rect.topLeft()); QPointF tr = map(rect.topRight()); + QPointF bl = map(rect.bottomLeft()); QPointF br = map(rect.bottomRight()); + + qreal xmin = qMin(qMin(tl.x(), tr.x()), qMin(bl.x(), br.x())); + qreal xmax = qMax(qMax(tl.x(), tr.x()), qMax(bl.x(), br.x())); + qreal ymin = qMin(qMin(tl.y(), tr.y()), qMin(bl.y(), br.y())); + qreal ymax = qMax(qMax(tl.y(), tr.y()), qMax(bl.y(), br.y())); + + return QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax)); +} + /*! \fn float *QMatrix4x4::data() diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index 2b485c1..79613a0 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -130,9 +130,11 @@ public: QMatrix4x4& translate(const QVector3D& vector); QMatrix4x4& rotate(qreal angle, const QVector3D& vector); #endif - QMatrix4x4& scale(qreal x, qreal y, qreal z = 1.0f); + QMatrix4x4& scale(qreal x, qreal y); + QMatrix4x4& scale(qreal x, qreal y, qreal z); QMatrix4x4& scale(qreal factor); - QMatrix4x4& translate(qreal x, qreal y, qreal z = 0.0f); + QMatrix4x4& translate(qreal x, qreal y); + QMatrix4x4& translate(qreal x, qreal y, qreal z); QMatrix4x4& rotate(qreal angle, qreal x, qreal y, qreal z = 0.0f); #ifndef QT_NO_QUATERNION QMatrix4x4& rotate(const QQuaternion& quaternion); @@ -914,19 +916,6 @@ inline QRect QMatrix4x4::mapRect(const QRect& rect) const return QRect(QPoint(xmin, ymin), QPoint(xmax, ymax)); } -inline QRectF QMatrix4x4::mapRect(const QRectF& rect) const -{ - QPointF tl = map(rect.topLeft()); QPointF tr = map(rect.topRight()); - QPointF bl = map(rect.bottomLeft()); QPointF br = map(rect.bottomRight()); - - qreal xmin = qMin(qMin(tl.x(), tr.x()), qMin(bl.x(), br.x())); - qreal xmax = qMax(qMax(tl.x(), tr.x()), qMax(bl.x(), br.x())); - qreal ymin = qMin(qMin(tl.y(), tr.y()), qMin(bl.y(), br.y())); - qreal ymax = qMax(qMax(tl.y(), tr.y()), qMax(bl.y(), br.y())); - - return QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax)); -} - inline float *QMatrix4x4::data() { // We have to assume that the caller will modify the matrix elements, |