aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 21:48:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:36 +0200
commit6c9f1c8ed93374c16ca6ac540f39e98b451be0d8 (patch)
tree476d0046c6016a8cd62bfc29ed9697d98e98f738 /src/quick/items/context2d
parentbdb27b96acbd38531879378c48959a5a1cd60963 (diff)
Use a ReturnedValue for Managed::getIndexed()
Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/context2d')
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 81f5505245..cf692c34eb 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -873,7 +873,7 @@ struct QQuickJSContext2DPixelData : public QV4::Object
static void destroy(QV4::Managed *that) {
static_cast<QQuickJSContext2DPixelData *>(that)->~QQuickJSContext2DPixelData();
}
- static QV4::Value getIndexed(QV4::Managed *m, uint index, bool *hasProperty);
+ static QV4::ReturnedValue getIndexed(QV4::Managed *m, uint index, bool *hasProperty);
static void putIndexed(QV4::Managed *m, uint index, const QV4::Value &value);
static QV4::Value proto_get_length(QV4::SimpleCallContext *ctx);
@@ -3005,7 +3005,7 @@ QV4::Value QQuickJSContext2DPixelData::proto_get_length(QV4::SimpleCallContext *
return QV4::Value::fromInt32(r->image.width() * r->image.height() * 4);
}
-QV4::Value QQuickJSContext2DPixelData::getIndexed(QV4::Managed *m, uint index, bool *hasProperty)
+QV4::ReturnedValue QQuickJSContext2DPixelData::getIndexed(QV4::Managed *m, uint index, bool *hasProperty)
{
QQuickJSContext2DPixelData *r = m->as<QQuickJSContext2DPixelData>();
if (!m)
@@ -3021,18 +3021,18 @@ QV4::Value QQuickJSContext2DPixelData::getIndexed(QV4::Managed *m, uint index, b
pixel += col;
switch (index % 4) {
case 0:
- return QV4::Value::fromInt32(qRed(*pixel));
+ return QV4::Value::fromInt32(qRed(*pixel)).asReturnedValue();
case 1:
- return QV4::Value::fromInt32(qGreen(*pixel));
+ return QV4::Value::fromInt32(qGreen(*pixel)).asReturnedValue();
case 2:
- return QV4::Value::fromInt32(qBlue(*pixel));
+ return QV4::Value::fromInt32(qBlue(*pixel)).asReturnedValue();
case 3:
- return QV4::Value::fromInt32(qAlpha(*pixel));
+ return QV4::Value::fromInt32(qAlpha(*pixel)).asReturnedValue();
}
}
if (hasProperty)
*hasProperty = false;
- return QV4::Value::undefinedValue();
+ return QV4::Value::undefinedValue().asReturnedValue();
}
void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const QV4::Value &value)