From 278b144a35fb5e5068877cfd456b58d690b9caaf Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 10 Apr 2018 22:45:27 +0200 Subject: Disambiguate different allocation functions in the memory manager Some compilers (in this case MingW 5.3) don't manage to properly disambiguate the template overloads, and try to instantiate the wrong template function. Solve this by renaming the one of the template functions. Change-Id: I3574e617fe96c4bd52920a0127a1dfe39cc3d302 Reviewed-by: Simon Hausmann --- src/quick/items/context2d/qquickcontext2d.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/quick/items/context2d/qquickcontext2d.cpp') diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index af8048f2e4..e01e87b45a 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -596,7 +596,7 @@ public: static QV4::Heap::QQuickJSContext2DPrototype *create(QV4::ExecutionEngine *engine) { QV4::Scope scope(engine); - QV4::Scoped o(scope, engine->memoryManager->allocObject()); + QV4::Scoped o(scope, engine->memoryManager->allocate()); o->defineDefaultProperty(QStringLiteral("quadraticCurveTo"), method_quadraticCurveTo, 0); o->defineDefaultProperty(QStringLiteral("restore"), method_restore, 0); @@ -954,7 +954,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE { QV4::Scope scope(v4); QQuickContext2DEngineData *ed = engineData(scope.engine); - QV4::Scoped pixelData(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped pixelData(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->pixelArrayProto.value()); pixelData->setPrototype(p); @@ -966,7 +966,7 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE *pixelData->d()->image = image.format() == QImage::Format_ARGB32 ? image : image.convertToFormat(QImage::Format_ARGB32); } - QV4::Scoped imageData(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped imageData(scope, scope.engine->memoryManager->allocate()); imageData->d()->pixelData = pixelData.asReturnedValue(); return imageData.asReturnedValue(); } @@ -1582,7 +1582,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(const } QQuickContext2DEngineData *ed = engineData(scope.engine); - QV4::Scoped gradient(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); gradient->setPrototype(p); *gradient->d()->brush = QLinearGradient(x0, y0, x1, y1); @@ -1634,7 +1634,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(const QQuickContext2DEngineData *ed = engineData(scope.engine); - QV4::Scoped gradient(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); gradient->setPrototype(p); *gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0)); @@ -1678,7 +1678,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(cons QQuickContext2DEngineData *ed = engineData(scope.engine); - QV4::Scoped gradient(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped gradient(scope, scope.engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->gradientProto.value()); gradient->setPrototype(p); *gradient->d()->brush = QConicalGradient(x, y, angle); @@ -1738,7 +1738,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(const QV4::F CHECK_CONTEXT(r) if (argc >= 2) { - QV4::Scoped pattern(scope, scope.engine->memoryManager->allocObject()); + QV4::Scoped pattern(scope, scope.engine->memoryManager->allocate()); QColor color = scope.engine->toVariant(argv[0], qMetaTypeId()).value(); if (color.isValid()) { @@ -4399,7 +4399,7 @@ void QQuickContext2D::setV4Engine(QV4::ExecutionEngine *engine) QQuickContext2DEngineData *ed = engineData(engine); QV4::Scope scope(engine); - QV4::Scoped wrapper(scope, engine->memoryManager->allocObject()); + QV4::Scoped wrapper(scope, engine->memoryManager->allocate()); QV4::ScopedObject p(scope, ed->contextPrototype.value()); wrapper->setPrototype(p); wrapper->d()->context = this; -- cgit v1.2.3