aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4typedarray_p.h
diff options
context:
space:
mode:
authorPasi Keranen <pasi.keranen@digia.com>2015-02-10 13:52:04 +0200
committerPasi Keränen <pasi.keranen@digia.com>2015-02-11 07:25:38 +0000
commit08bd120f012949199ee0c1d20d42a628af01289e (patch)
treeb5bdc008a43cf5b6287b3614840bdf55c6e71de0 /src/qml/jsruntime/qv4typedarray_p.h
parentf09bd9825b29612f98d884460504b07150bcb639 (diff)
Exposed TypedArray private APIs for Canvas3D use.
Exported QV4::TypedArray, QV4::ArrayBuffer and QV4::Heap::ArrayBuffer in to the private API set. Changed ArrayBuffer length in the constructor to size_t instead of int. Added accessor methods to TypedArray array type and byte length. Change-Id: I3f89b8e263012bc90cc665aed5744cbc66379204 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4typedarray_p.h')
-rw-r--r--src/qml/jsruntime/qv4typedarray_p.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4typedarray_p.h b/src/qml/jsruntime/qv4typedarray_p.h
index 78949226b8..670a55157c 100644
--- a/src/qml/jsruntime/qv4typedarray_p.h
+++ b/src/qml/jsruntime/qv4typedarray_p.h
@@ -35,6 +35,7 @@
#include "qv4object_p.h"
#include "qv4functionobject_p.h"
+#include "qv4arraybuffer_p.h"
QT_BEGIN_NAMESPACE
@@ -74,6 +75,7 @@ struct TypedArray : Object {
ArrayBuffer *buffer;
uint byteLength;
uint byteOffset;
+ Type arrayType;
};
struct TypedArrayCtor : FunctionObject {
@@ -90,14 +92,25 @@ struct TypedArrayPrototype : Object {
}
-struct TypedArray : Object
+struct Q_QML_PRIVATE_EXPORT TypedArray : Object
{
V4_OBJECT2(TypedArray, Object)
+ uint byteLength() const {
+ return d()->byteLength;
+ }
+
uint length() const {
return d()->byteLength/d()->type->bytesPerElement;
}
+ QTypedArrayData<char> *arrayData() {
+ return d()->buffer->data;
+ }
+
+ Heap::TypedArray::Type arrayType() const {
+ return d()->arrayType;
+ }
static void markObjects(Heap::Base *that, ExecutionEngine *e);
static ReturnedValue getIndexed(Managed *m, uint index, bool *hasProperty);