diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-12-30 11:39:53 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-02 21:10:43 +0100 |
commit | 2056538feab7739689742de4efe370b35864bc9a (patch) | |
tree | 82845eea2eca647bc45dc63e13ea35712a692e54 /src/quick/items/context2d/qquickcontext2d.cpp | |
parent | 96178192c451a5e26e30e14a619b96aacd16c29b (diff) |
Remove v8engine dependency in toVariant conversions
Change-Id: I0f2f77c9cc268a0c5ca3ffe0cd66fc98bb1964b3
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 | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index 77f75d796d..d8e45305cf 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -1385,10 +1385,9 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_fillStyle(QV4::CallContext *ctx CHECK_CONTEXT_SETTER(r) QV4::ScopedValue value(scope, ctx->argument(0)); - QV8Engine *engine = scope.engine->v8Engine; if (value->asObject()) { - QColor color = engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>(); + QColor color = QV8Engine::toVariant(scope.engine, value, qMetaTypeId<QColor>()).value<QColor>(); if (color.isValid()) { r->d()->context->state.fillStyle = color; r->d()->context->buffer()->setFillStyle(color); @@ -1495,11 +1494,10 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(QV4::CallContext *c QV4::Scoped<QQuickJSContext2D> r(scope, ctx->d()->callData->thisObject.as<QQuickJSContext2D>()); CHECK_CONTEXT_SETTER(r) - QV8Engine *engine = scope.engine->v8Engine; QV4::ScopedValue value(scope, ctx->argument(0)); if (value->asObject()) { - QColor color = engine->toVariant(value, qMetaTypeId<QColor>()).value<QColor>(); + QColor color = QV8Engine::toVariant(scope.engine, value, qMetaTypeId<QColor>()).value<QColor>(); if (color.isValid()) { r->d()->context->state.fillStyle = color; r->d()->context->buffer()->setStrokeStyle(color); @@ -1724,12 +1722,10 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon QV4::Scoped<QQuickJSContext2D> r(scope, ctx->d()->callData->thisObject); CHECK_CONTEXT(r) - QV8Engine *engine = scope.engine->v8Engine; - if (ctx->d()->callData->argc >= 2) { QV4::Scoped<QQuickContext2DStyle> pattern(scope, scope.engine->memoryManager->alloc<QQuickContext2DStyle>(scope.engine)); - QColor color = engine->toVariant(ctx->d()->callData->args[0], qMetaTypeId<QColor>()).value<QColor>(); + QColor color = QV8Engine::toVariant(scope.engine, ctx->d()->callData->args[0], qMetaTypeId<QColor>()).value<QColor>(); if (color.isValid()) { int patternMode = ctx->d()->callData->args[1].toInt32(); Qt::BrushStyle style = Qt::SolidPattern; @@ -3373,8 +3369,6 @@ QV4::ReturnedValue QQuickContext2DStyle::gradient_proto_addColorStop(QV4::CallCo if (!style) V4THROW_ERROR("Not a CanvasGradient object"); - QV8Engine *engine = scope.engine->v8Engine; - if (ctx->d()->callData->argc == 2) { if (!style->d()->brush.gradient()) @@ -3384,7 +3378,7 @@ QV4::ReturnedValue QQuickContext2DStyle::gradient_proto_addColorStop(QV4::CallCo QColor color; if (ctx->d()->callData->args[1].asObject()) { - color = engine->toVariant(ctx->d()->callData->args[1], qMetaTypeId<QColor>()).value<QColor>(); + color = QV8Engine::toVariant(scope.engine, ctx->d()->callData->args[1], qMetaTypeId<QColor>()).value<QColor>(); } else { color = qt_color_from_string(ctx->d()->callData->args[1]); } |