From d3a6412c66f62aa045f2856b0bf0ede4af10a984 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 1 Dec 2014 16:13:20 +0100 Subject: Remove most of the places where getPointer() is used This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann --- src/quick/items/context2d/qquickcontext2d.cpp | 18 +++++++++--------- src/quick/items/qquickitem.cpp | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/quick/items') diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 9e1d3b345c..77f75d796d 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -567,10 +567,10 @@ struct QQuickJSContext2DPrototype : public QV4::Object { V4_OBJECT2(QQuickJSContext2DPrototype, QV4::Object) public: - static QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) + static QV4::Heap::QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) { QV4::Scope scope(engine); - QV4::ScopedObject o(scope, engine->memoryManager->alloc(engine)); + QV4::Scoped o(scope, engine->memoryManager->alloc(engine)); o->defineDefaultProperty(QStringLiteral("quadraticCurveTo"), method_quadraticCurveTo, 0); o->defineDefaultProperty(QStringLiteral("restore"), method_restore, 0); @@ -617,7 +617,7 @@ public: o->defineDefaultProperty(QStringLiteral("closePath"), method_closePath, 0); o->defineAccessorProperty(QStringLiteral("canvas"), QQuickJSContext2DPrototype::method_get_canvas, 0); - return static_cast(o.getPointer()); + return o->d(); } static QV4::ReturnedValue method_get_canvas(QV4::CallContext *ctx); @@ -942,7 +942,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV8Engine* engi QV4::Scope scope(v4); QV4::Scoped pixelData(scope, scope.engine->memoryManager->alloc(v4)); QV4::ScopedObject p(scope, ed->pixelArrayProto.value()); - pixelData->setPrototype(p.getPointer()); + pixelData->setPrototype(p); if (image.isNull()) { pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32); @@ -1568,7 +1568,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(QV4:: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QLinearGradient(x0, y0, x1, y1); return gradient.asReturnedValue(); } @@ -1622,7 +1622,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(QV4:: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0)); return gradient.asReturnedValue(); } @@ -1668,7 +1668,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(QV4: QV4::Scoped gradient(scope, scope.engine->memoryManager->alloc(scope.engine)); QV4::ScopedObject p(scope, ed->gradientProto.value()); - gradient->setPrototype(p.getPointer()); + gradient->setPrototype(p); gradient->d()->brush = QConicalGradient(x, y, angle); return gradient.asReturnedValue(); } @@ -1742,7 +1742,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon if (QV4::Object *o = ctx->d()->callData->args[0].asObject()) { QV4::ScopedString s(scope, scope.engine->newString(QStringLiteral("data"))); - QV4::Scoped pixelData(scope, o->get(s.getPointer())); + QV4::Scoped pixelData(scope, o->get(s)); if (!!pixelData) { patternTexture = pixelData->d()->image; } @@ -4332,7 +4332,7 @@ void QQuickContext2D::setV8Engine(QV8Engine *engine) QV4::Scope scope(v4Engine); QV4::Scoped wrapper(scope, v4Engine->memoryManager->alloc(v4Engine)); QV4::ScopedObject p(scope, ed->contextPrototype.value()); - wrapper->setPrototype(p.getPointer()); + wrapper->setPrototype(p); wrapper->d()->context = this; m_v4value = wrapper; } diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 6ae74281ca..dc68808748 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -4169,15 +4169,15 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const QRectF r = mapRectFromItem(itemObj, QRectF(x, y, w, h)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y()))); + rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width()))); + rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height()))); } else { QPointF p = mapFromItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y()))); } } } @@ -4249,15 +4249,15 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const QRectF r = mapRectToItem(itemObj, QRectF(x, y, w, h)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(r.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(r.y()))); - rv->put((s = v4->newString(QStringLiteral("width"))).getPointer(), (v = QV4::Primitive::fromDouble(r.width()))); - rv->put((s = v4->newString(QStringLiteral("height"))).getPointer(), (v = QV4::Primitive::fromDouble(r.height()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(r.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(r.y()))); + rv->put((s = v4->newString(QStringLiteral("width"))), (v = QV4::Primitive::fromDouble(r.width()))); + rv->put((s = v4->newString(QStringLiteral("height"))), (v = QV4::Primitive::fromDouble(r.height()))); } else { QPointF p = mapToItem(itemObj, QPointF(x, y)); - rv->put((s = v4->newString(QStringLiteral("x"))).getPointer(), (v = QV4::Primitive::fromDouble(p.x()))); - rv->put((s = v4->newString(QStringLiteral("y"))).getPointer(), (v = QV4::Primitive::fromDouble(p.y()))); + rv->put((s = v4->newString(QStringLiteral("x"))), (v = QV4::Primitive::fromDouble(p.x()))); + rv->put((s = v4->newString(QStringLiteral("y"))), (v = QV4::Primitive::fromDouble(p.y()))); } } } -- cgit v1.2.3