aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-01-13 09:01:29 +0100
committerLars Knoll <lars.knoll@digia.com>2015-01-13 22:42:04 +0100
commit39f1e0d66dc434e764731fbfed29c8fd98d217aa (patch)
treed9855dbedd752c23395ccb6d4d3dc8fc3bece254 /src/quick/items/context2d
parenta38f9ec6c96559efa56e8f7346f74f5990810c3a (diff)
Make sure we always have an engine when assigning to a Persistent
This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/context2d')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 2688c723ed..f8ed81d2a5 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -864,7 +864,7 @@ void QQuickCanvasItem::requestAnimationFrame(QQmlV4Function *args)
static int id = 0;
- d->animationCallbacks.insert(++id, QV4::PersistentValue(f));
+ d->animationCallbacks.insert(++id, QV4::PersistentValue(scope.engine, f));
if (isVisible())
polish();
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index e46aa53755..da4212e5b1 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1390,13 +1390,13 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_fillStyle(QV4::CallContext *ctx
if (color.isValid()) {
r->d()->context->state.fillStyle = color;
r->d()->context->buffer()->setFillStyle(color);
- r->d()->context->m_fillStyle = value;
+ r->d()->context->m_fillStyle.set(scope.engine, value);
} else {
QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>());
if (style && style->d()->brush != r->d()->context->state.fillStyle) {
r->d()->context->state.fillStyle = style->d()->brush;
r->d()->context->buffer()->setFillStyle(style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
- r->d()->context->m_fillStyle = value;
+ r->d()->context->m_fillStyle.set(scope.engine, value);
r->d()->context->state.fillPatternRepeatX = style->d()->patternRepeatX;
r->d()->context->state.fillPatternRepeatY = style->d()->patternRepeatY;
}
@@ -1406,7 +1406,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_fillStyle(QV4::CallContext *ctx
if (color.isValid() && r->d()->context->state.fillStyle != QBrush(color)) {
r->d()->context->state.fillStyle = QBrush(color);
r->d()->context->buffer()->setFillStyle(r->d()->context->state.fillStyle);
- r->d()->context->m_fillStyle = value;
+ r->d()->context->m_fillStyle.set(scope.engine, value);
}
}
return QV4::Encode::undefined();
@@ -1499,13 +1499,13 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(QV4::CallContext *c
if (color.isValid()) {
r->d()->context->state.fillStyle = color;
r->d()->context->buffer()->setStrokeStyle(color);
- r->d()->context->m_strokeStyle = value;
+ r->d()->context->m_strokeStyle.set(scope.engine, value);
} else {
QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>());
if (style && style->d()->brush != r->d()->context->state.strokeStyle) {
r->d()->context->state.strokeStyle = style->d()->brush;
r->d()->context->buffer()->setStrokeStyle(style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
- r->d()->context->m_strokeStyle = value;
+ r->d()->context->m_strokeStyle.set(scope.engine, value);
r->d()->context->state.strokePatternRepeatX = style->d()->patternRepeatX;
r->d()->context->state.strokePatternRepeatY = style->d()->patternRepeatY;
@@ -1516,7 +1516,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(QV4::CallContext *c
if (color.isValid() && r->d()->context->state.strokeStyle != QBrush(color)) {
r->d()->context->state.strokeStyle = QBrush(color);
r->d()->context->buffer()->setStrokeStyle(r->d()->context->state.strokeStyle);
- r->d()->context->m_strokeStyle = value;
+ r->d()->context->m_strokeStyle.set(scope.engine, value);
}
}
return QV4::Encode::undefined();
@@ -2076,7 +2076,7 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_path(QV4::CallContext *ctx)
QString path =value->toQStringNoThrow();
QQuickSvgParser::parsePathDataFast(path, r->d()->context->m_path);
}
- r->d()->context->m_v4path = value;
+ r->d()->context->m_v4path.set(scope.engine, value);
return QV4::Encode::undefined();
}