diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-12-05 14:32:21 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-12-20 07:52:18 +0000 |
commit | 3ffb0d49d3e6b420c8c0952d2b780c95baf3cb0b (patch) | |
tree | 45e41d734842876a30b386e2636b4a68dcf66fc8 | |
parent | 77c28171ac2f5de2183542af9cfe5bd7cd02974e (diff) |
Update Canvas3D to the new internal API used in QtQml
Fixes compilation against a recent version of qtdeclarative.
Change-Id: If21b743b0226f3a5c78d46fa985822f9357a0622
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/imports/qtcanvas3d/context3d.cpp | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/src/imports/qtcanvas3d/context3d.cpp b/src/imports/qtcanvas3d/context3d.cpp index 7b2e590..bad4e4f 100644 --- a/src/imports/qtcanvas3d/context3d.cpp +++ b/src/imports/qtcanvas3d/context3d.cpp @@ -4422,10 +4422,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Float32Array (with 4 values) @@ -4443,10 +4440,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Int32Array (with 2 elements) @@ -4461,10 +4455,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // Int32Array (with 4 elements) // Intentional flow through @@ -4480,10 +4471,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } // sequence<GLboolean> (with 4 values) @@ -4560,10 +4548,7 @@ QJSValue CanvasContext::getParameter(glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::UInt32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } case FRAMEBUFFER_BINDING: { return m_engine->newQObject(m_currentFramebuffer); @@ -5702,10 +5687,7 @@ QJSValue CanvasContext::getVertexAttrib(uint index, glEnums pname) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } default: @@ -5906,10 +5888,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Int32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } case FLOAT_VEC2: @@ -5932,10 +5911,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } case BOOL_VEC2: @@ -5981,10 +5957,7 @@ QJSValue CanvasContext::getUniform(QJSValue program3D, QJSValue location3D) QV4::ScopedFunctionObject constructor(scope, m_v4engine->typedArrayCtors[ QV4::Heap::TypedArray::Float32Array]); - QV4::ScopedCallData callData(scope, 1); - callData->args[0] = buffer; - constructor->construct(scope, callData); - return QJSValue(m_v4engine, scope.result.asReturnedValue()); + return QJSValue(m_v4engine, constructor->callAsConstructor(buffer, 1)); } } default: |