Commit c35dda81 authored by Miikka Heikkinen's avatar Miikka Heikkinen Committed by Pasi Keränen
Browse files

Refactored typed array handling


Reduced copy/paste by centralizing typed array data pointer resolving.
It now also uses byte offset in typed arrays if they have it.

Change-Id: I2d3d63ba0a8056884044ac73e47bf3821279be97
Task-number: QTBUG-45825
Reviewed-by: default avatarPasi Keränen <pasi.keranen@digia.com>
Showing with 207 additions and 212 deletions
This diff is collapsed.
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#include <QtQml> #include <QtQml>
#include <QtQml/QJSEngine> #include <QtQml/QJSEngine>
#include <QtQml/private/qqmlengine_p.h> #include <QtQml/private/qqmlengine_p.h>
#include <QtQml/private/qv4typedarray_p.h>
#ifdef NO_ERROR // may de defined in winerror.h #ifdef NO_ERROR // may de defined in winerror.h
#undef NO_ERROR #undef NO_ERROR
...@@ -1184,8 +1185,13 @@ signals: ...@@ -1184,8 +1185,13 @@ signals:
void drawingBufferHeightChanged(); void drawingBufferHeightChanged();
private: private:
uchar *getAsUint8ArrayRawPtr(QJSValue value); uchar *getTypedArrayAsRawDataPtr(const QJSValue &jsValue, int &byteLength,
uchar *getAsUint16ArrayRawPtr(QJSValue value); QV4::Heap::TypedArray::Type type);
uchar *getTypedArrayAsRawDataPtr(const QJSValue &jsValue,
QV4::Heap::TypedArray::Type type);
uchar *getTypedArrayAsRawDataPtr(const QJSValue &jsValue, int &byteLength);
uchar *getArrayBufferAsRawDataPtr(const QJSValue &jsValue, int &byteLength);
CanvasTexture *getAsTexture3D(QJSValue anyObject); CanvasTexture *getAsTexture3D(QJSValue anyObject);
CanvasTextureImage* getAsTextureImage(QJSValue image); CanvasTextureImage* getAsTextureImage(QJSValue image);
CanvasFrameBuffer *getAsFramebuffer(QJSValue anyObject); CanvasFrameBuffer *getAsFramebuffer(QJSValue anyObject);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment