diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-01-15 11:36:57 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-23 08:07:32 +0100 |
commit | 002a5d4303b3b182ae4abc4a752c49787c1c2821 (patch) | |
tree | 69c7666ed1061c7acacee1d76597c06405459c80 /src/quick/items/context2d/qquickcontext2d.cpp | |
parent | fddc75e862032163af36d2282051758647b62d15 (diff) |
Get rid of most uses of ValueRef
Instead pass a const Value & into the functions
With our new inheritance structure, we can get rid of ValueRef
and instead simply pass a pointer to a Value again. Pointers to
Values are safe to use again now, as they are now guaranteed to
be in a place where the GC knows about them.
Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2d.cpp')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 87b42f6f19..d38299bb4d 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -887,7 +887,7 @@ struct QQuickJSContext2DPixelData : public QV4::Object V4_NEEDS_DESTROY static QV4::ReturnedValue getIndexed(QV4::Managed *m, uint index, bool *hasProperty); - static void putIndexed(QV4::Managed *m, uint index, const QV4::ValueRef value); + static void putIndexed(QV4::Managed *m, uint index, const QV4::Value &value); static QV4::ReturnedValue proto_get_length(QV4::CallContext *ctx); }; @@ -3122,7 +3122,7 @@ QV4::ReturnedValue QQuickJSContext2DPixelData::getIndexed(QV4::Managed *m, uint return QV4::Encode::undefined(); } -void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const QV4::ValueRef value) +void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const QV4::Value &value) { Q_ASSERT(m->as<QQuickJSContext2DPixelData>()); QV4::ExecutionEngine *v4 = static_cast<QQuickJSContext2DPixelData *>(m)->engine(); @@ -3132,7 +3132,7 @@ void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const Q QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<QQuickJSContext2DPixelData *>(m)); - const int v = value->toInt32(); + const int v = value.toInt32(); if (r && index < static_cast<quint32>(r->d()->image.width() * r->d()->image.height() * 4) && v >= 0 && v <= 255) { const quint32 w = r->d()->image.width(); const quint32 row = (index / 4) / w; |