alphaString += QLatin1Char('0');
return engine->toString(QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString));
}
- return r->context->m_fillStyle;
+ return r->context->m_fillStyle.value();
}
static void ctx2d_fillStyle_set(v8::Handle<v8::String>, v8::Handle<v8::Value> value, const v8::AccessorInfo &info)
if (color.isValid()) {
r->context->state.fillStyle = color;
r->context->buffer()->setFillStyle(color);
- r->context->m_fillStyle = value;
+ r->context->m_fillStyle = value->v4Value();
} else {
QV8Context2DStyleResource *style = v8_resource_cast<QV8Context2DStyleResource>(value->ToObject());
if (style && style->brush != r->context->state.fillStyle) {
r->context->state.fillStyle = style->brush;
r->context->buffer()->setFillStyle(style->brush, style->patternRepeatX, style->patternRepeatY);
- r->context->m_fillStyle = value;
+ r->context->m_fillStyle = value->v4Value();
r->context->state.fillPatternRepeatX = style->patternRepeatX;
r->context->state.fillPatternRepeatY = style->patternRepeatY;
}
if (color.isValid() && r->context->state.fillStyle != QBrush(color)) {
r->context->state.fillStyle = QBrush(color);
r->context->buffer()->setFillStyle(r->context->state.fillStyle);
- r->context->m_fillStyle = value;
+ r->context->m_fillStyle = value->v4Value();
}
}
}
alphaString += QLatin1Char('0');
return engine->toString(QString::fromLatin1("rgba(%1, %2, %3, %4)").arg(color.red()).arg(color.green()).arg(color.blue()).arg(alphaString));
}
- return r->context->m_strokeStyle;
+ return r->context->m_strokeStyle.value();
}
static void ctx2d_strokeStyle_set(v8::Handle<v8::String>, v8::Handle<v8::Value> value, const v8::AccessorInfo &info)
if (color.isValid()) {
r->context->state.fillStyle = color;
r->context->buffer()->setStrokeStyle(color);
- r->context->m_strokeStyle = value;
+ r->context->m_strokeStyle = value->v4Value();
} else {
QV8Context2DStyleResource *style = v8_resource_cast<QV8Context2DStyleResource>(value->ToObject());
if (style && style->brush != r->context->state.strokeStyle) {
r->context->state.strokeStyle = style->brush;
r->context->buffer()->setStrokeStyle(style->brush, style->patternRepeatX, style->patternRepeatY);
- r->context->m_strokeStyle = value;
+ r->context->m_strokeStyle = value->v4Value();
r->context->state.strokePatternRepeatX = style->patternRepeatX;
r->context->state.strokePatternRepeatY = style->patternRepeatY;
if (color.isValid() && r->context->state.strokeStyle != QBrush(color)) {
r->context->state.strokeStyle = QBrush(color);
r->context->buffer()->setStrokeStyle(r->context->state.strokeStyle);
- r->context->m_strokeStyle = value;
+ r->context->m_strokeStyle = value->v4Value();
}
}
}
{
QQuickJSContext2D *r = info.This()->v4Value().as<QQuickJSContext2D>();
CHECK_CONTEXT(r)
- return r->context->m_v8path;
+ return r->context->m_v4path.value();
}
static void ctx2d_path_set(v8::Handle<v8::String>, v8::Handle<v8::Value> value, const v8::AccessorInfo &info)
QString path = value->v4Value().toQString();
QQuickSvgParser::parsePathDataFast(path, r->context->m_path);
}
- r->context->m_v8path = value;
+ r->context->m_v4path = value->v4Value();
}
//rects
#include <private/qv8engine_p.h>
#include <QtCore/QWaitCondition>
+#include <private/qv4value_p.h>
//#define QQUICKCONTEXT2D_DEBUG //enable this for just DEBUG purpose!
QQuickCanvasItem* m_canvas;
QQuickContext2DCommandBuffer* m_buffer;
QPainterPath m_path;
- v8::Handle<v8::Value> m_fillStyle;
- v8::Handle<v8::Value> m_strokeStyle;
- v8::Handle<v8::Value> m_v8path;
+ QV4::PersistentValue m_fillStyle;
+ QV4::PersistentValue m_strokeStyle;
+ QV4::PersistentValue m_v4path;
QV8Engine *m_v8engine;
QSurface *m_surface;
QOpenGLContext *m_glContext;