diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-09 12:35:34 +1000 |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-09 12:35:34 +1000 |
commit | 7a9085ea5e0c5a1c22f40cf2ec1211b2d2114528 (patch) | |
tree | 234aae15054b5e15f3e5e8aed3ce5f22932eafc5 /src/declarative/items/qsgcanvasitem.cpp | |
parent | d9d952d3c0475b1e7f7b8df2b062f85f24387aca (diff) |
Port Canvas and Context2D to V8
Diffstat (limited to 'src/declarative/items/qsgcanvasitem.cpp')
-rw-r--r-- | src/declarative/items/qsgcanvasitem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/items/qsgcanvasitem.cpp b/src/declarative/items/qsgcanvasitem.cpp index a6403c0081..2ceb118465 100644 --- a/src/declarative/items/qsgcanvasitem.cpp +++ b/src/declarative/items/qsgcanvasitem.cpp @@ -99,20 +99,20 @@ void QSGCanvasItem::paint(QPainter *painter) } } -QScriptValue QSGCanvasItem::getContext(const QString &contextId) +QDeclarativeV8Handle QSGCanvasItem::getContext(const QString &contextId) { Q_D(QSGCanvasItem); - QScriptEngine* e = QDeclarativeEnginePrivate::getScriptEngine(qmlEngine(this)); + if (contextId == QLatin1String("2d")) { if (!d->context) { + QV8Engine *e = QDeclarativeEnginePrivate::getV8Engine(qmlEngine(this)); d->context = new QSGContext2D(this); - d->context->setScriptEngine(e); + d->context->setV8Engine(e); connect(d->context, SIGNAL(changed()), this, SLOT(requestPaint())); } - return d->context->scriptValue(); + return QDeclarativeV8Handle::fromHandle(d->context->v8value()); } - qDebug("Canvas:requesting unsupported context"); - return e->undefinedValue(); + return QDeclarativeV8Handle::fromHandle(v8::Undefined()); } void QSGCanvasItem::requestPaint() |