aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Reuse the memory we use for vertex uploads.Gunnar Sletta2015-01-062-11/+65
| | | | | | | | | | | | | | | | | | | | | Every batch would have its own buffer with its own memory and the original idea was that it would stabilize so that the same batch would be used over and over, so the memory allocatd for each batch's buffer would be reused. In practice batches get discarded and recycled in somewhat arbitrary order so we always end up reallocating. Instead, use a single buffer for all uploads. This saves us several reallocations per frame, and also prevents pooling of several potentially large allocated blocks inside the renderer. The exception is when using visualization or for drivers which have broken index buffer support (nouveau only currently), where we keep the existing behavior as the buffer data is needed during rendering and visualization. Change-Id: Id29095e00128ec1ee6d4ac3caa8f2c17cc7bbd27 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Some minimal changes to make qmlpuppet compile againhjk2015-01-062-2/+4
| | | | | | | | | Access to QJSEnginePrivate::createCache and the previous signature of QQmlPropertyCache::invalidate is used. Change-Id: Ie2578eee33ee4ebb2cdc4574d8d1cb7c8209868e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* Remove bogus assert.Gunnar Sletta2015-01-051-2/+0
| | | | | | | | | | It is perfectly valid to reparent nodes to a parent that is part of an existing hierarchy. Change-Id: Icf2dbe6030d399047e7ebe735e3096d1a8cd8c0e Task-number: QTBUG-43278 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Traverse children correctly when reparenting.Gunnar Sletta2015-01-051-1/+1
| | | | | | | | | | | Since the children are being removed from the parent, using nextSibling on the child won't work. We need to extract the first child from the parent until there are no more children left. Change-Id: Ifca5f2760e2b1c7ba56c198623c5dc9d82c7560f Task-number: QTBUG-42530 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Add propertyName to errorAlbert Astals Cid2015-01-053-3/+3
| | | | | | | | | May help a bit to the reader, even if the line is already there sometimes it can be confusing if it is a default property like data Change-Id: I5cb8e8833c78a784ad4f5541d094840477e8f350 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedObject typedef instead of actual typeOleg Shparber2015-01-0331-104/+104
| | | | | Change-Id: I0b68c534ea513a7c230b12114f6b42b069f9864b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedArrayObject typedef instead of actual typeOleg Shparber2015-01-0315-25/+25
| | | | | Change-Id: I975536745ac6c264aca074f84d223fbec7682d3d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedContext typedef instead of actual typeOleg Shparber2015-01-024-12/+12
| | | | | Change-Id: I71c6c9cf030e347fbc5e4073e9ca338a9ce95999 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedFunctionObject typedef instead of actual typeOleg Shparber2015-01-0218-32/+32
| | | | | Change-Id: I6b4effaa5bef992b4ae9402eea7fe655bc7b18f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedString typedef instead of actual typeOleg Shparber2015-01-0211-22/+22
| | | | | Change-Id: I64ecbf6cea463387a70e909ecc5f9165d22a7b0f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build: include <qdatastream.h> before using QDataStreamThiago Macieira2015-01-021-0/+1
| | | | | Change-Id: I779e0cd705f664368b47763d4367b9dc377c1770 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused variableLars Knoll2015-01-021-1/+0
| | | | | Change-Id: I399e66822f52e35d122d3a20bb8de20206e5864d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a direct accessor to retrieve the JS engine from the ExecutionEngineLars Knoll2015-01-023-1/+9
| | | | | Change-Id: I2617143e39f354657e12541f3796a583e9934118 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reduce v8engine dependency in the type wrapperLars Knoll2015-01-024-30/+22
| | | | | Change-Id: I3a50aa3c0929c14ad856463635bf2fb2188f5c9f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reduce v8engine dependency in qv4includeLars Knoll2015-01-022-6/+5
| | | | | Change-Id: Idc50e7ed9e0de5c8742688c8493c2124075450ee Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove v8engine dependency in fromVariant conversionsLars Knoll2015-01-0216-85/+69
| | | | | Change-Id: I3427129dc7a0e68c8fa0b61f353835e2bee179a0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove v8engine dependency in toVariant conversionsLars Knoll2015-01-0217-89/+71
| | | | | Change-Id: I0f2f77c9cc268a0c5ca3ffe0cd66fc98bb1964b3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Do not cause SegFault when importing empty javascriptNobuaki Sukegawa2015-01-027-5/+27
| | | | | Change-Id: I31f6571e73b5dd74bf3ade5cadc2daa02475b5cb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Enable gadget wrapping for custom value typesSimon Hausmann2015-01-0210-7/+161
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] Custom C++ value types annotated with Q_GADGET are now fully accessible in the QML and QJSEngine JavaScript environment. QJSEngine::toScriptValue can be used for injection and fromScriptValue to extraction. The QML "built-in" gadget wrappers for QPoint and the gui types are not exposed this way, toScriptValue(point) will still return an opaque QVariant wrapper. We could expose the core types right away, but then we would be lacking an API to enable use of the Gui types that are registered in QtQuick. It would be better to make the core types in qtbase gadgets and thus enable them without the need for hooks and init functions to be called by the user. Task-number: QTBUG-29769 Change-Id: I8179cd599bdc1209ff61cfdbdda419cb400296bb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove v8engine dependency from qv4serialize.*Lars Knoll2015-01-013-29/+27
| | | | | Change-Id: I5b4c1247286bf18c96df3b68b7bae9feefbbdbc9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't store a v8engine pointer in qqmllistwrapperLars Knoll2015-01-015-20/+16
| | | | | Change-Id: I21b055deb74aafff8b2ee1cdce776e06f154dcaa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused enum valueLars Knoll2015-01-011-2/+1
| | | | | Change-Id: I1e1a34a974cea129fcf4513c0a163254d6c114cd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix constructions of QJSEngine objectsLars Knoll2015-01-011-2/+3
| | | | | | | | The private class is not empty anymore, so calling the wrong constructor would lead to memory corruption Change-Id: I6d477fc63bba46be733273f548397c2a50ef2bf4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make QV4::Value::isNaN() inlineOleg Shparber2014-12-311-2/+2
| | | | | Change-Id: Ia80d3b150822ec9b3965c981d58660567ca73ec1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QV4::InternalClass: reserve space for transitions.Robin Burchell2014-12-311-0/+2
| | | | | | | Profiling of allocations shows that this is one of the most frequent allocators. Change-Id: Iae0350c61bfe37381577642b9a93064377f45c1d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QQmlPropertyCache available in QJSEngineSimon Hausmann2014-12-299-141/+161
| | | | | | | | | The QQmlEngine has two containers for property caches, one for QML types and one for all-purpose meta-objects. The latter is rather useful and now being moved to QJSEngine to be available there. Change-Id: Ieab65c400b8a2e410e5f9eee6d603162dbb864d9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Prepare for QQmlPropertyCache to become available in QJSEngineSimon Hausmann2014-12-296-42/+32
| | | | | | | | | The cache is seemingly tied to QQmlEngine, but it isn't. A lot of times a QQmlEngine parameter is unnecessarily dragged around and the engine member is option as well as it turns out. Change-Id: Iffd2a5046e9785249689ebfcbc8a0ad509f76aea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on MinGWKonstantin Ritt2014-12-282-1/+6
| | | | | | | | - alloca() needs malloc.h - crtdbg.h couldn't be found on MinGW Change-Id: Ibbf91a58d39ef1e2572baae3c409393acf7aa5df Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Removed usage of QQmlValueType in QQmlValueTypeWrapperSimon Hausmann2014-12-286-147/+138
| | | | | | | | | | | | | | | QQmlValueType doesn't have anything really necessary :). Some code it has, but that was only called from the wrapper, so it was moved there. This also reduces one level of memory allocation for the wrapper. In theory the allocation for the JavaScript wrapper could be changed to be the size of the wrapper _plus_ the size needed for the gadget. However in anticipation of wanting to be able to move objects, we can't do that as we can't memmove() gadgets around - they might contain pointers to memory areas within. Change-Id: Icb5a6f5513e3b2c87f6639f6f7b1fb572af08137 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QV4::CallData::argument() method constantOleg Shparber2014-12-271-1/+1
| | | | | Change-Id: Id2640f6a0c08069764baeac606a25fdb53b23419 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* support XMLHttpRequest sync modeTasuku Suzuki2014-12-264-23/+72
| | | | | | | [ChangeLog][QtQml][XMLHttpRequest] Supported synchronous requests Change-Id: Ia38fcf97f212a14657bb519240d8406368a72390 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prepare method invocation in QObject bindings for gadget supportSimon Hausmann2014-12-236-54/+118
| | | | | | | | | | In order to support calling invokable methods in gadgets from JavaScript, the wrapper code needs to be able to operate on gadgets and not only QObject pointers. The minimal abstraction for that - QQmlGadgetOrObject - is passed through the relevant invocation methods in the wrapper for that. Change-Id: I94f939c942241f49dce4d32d05bf24822b2d331b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move methodParameterTypes and methodReturnType helper functionsSimon Hausmann2014-12-234-151/+140
| | | | | | | | | | | | | These can extract the type information from either a property cache (through QQmlData from a QObject) or (fallback) from a QMetaObject. The difference between a QMetaObject and a QQmlPropertyCache is what QQmlMetaObject abstracts and therefore we can move the functions there. This is in preparation for gadget support and also avoids the repeated QQmlData::get() dance but allows the re-use of a QQmlMetaObject instance in the future to do that dance only once. Change-Id: Ibff6ce498d09fabc97e0801653edc5b1ff446c6a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reduce dependencies on QQmlValueType being a QObjectSimon Hausmann2014-12-232-24/+10
| | | | | | | | Don't rely on caching the property cache in the QQmlData of the value type, instead we can cache is in the engine and store it in our object data. Change-Id: I5f31313c066cd7918caf33e3fabdf5aac71f1adb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Photosurface example: scale and rotate the frame, not the imageShawn Rutledge2014-12-231-10/+10
| | | | | | | | | | | | | | | | | The size of the border around the image could otherwise change dramatically, because the PinchArea was zooming the image. It's conceivable that the frame could follow the image in scale and rotation, but that doesn't work as long as the image is inside the frame, because changing scale and rotation of the parent affects the child too. So it follows that the scale and rotation of the image should never be directly set. This helps the apparent size of the white border around each image to be visually consistent. Another advantage is that the the image centroid doesn't tend to move, so compensation is not necessary. Change-Id: Ib7767e369097b32f006274add73ac544aedaf839 Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Further value type wrapper cleanupsSimon Hausmann2014-12-234-40/+40
| | | | | | | Removed the QV8Engine * member in QQmlValueTypeWrapper. Change-Id: I37cc131a3ff0279240b227c11a6b74bfc7bf4960 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Begin cleaning up QQmlValueTypeWrapperSimon Hausmann2014-12-232-99/+45
| | | | | | | | | | | | | Get rid of the objectType member. Instead of checking for it and then static_cast'ing to the specific class, it's easier to use Managed's as<> template cast. Also elimiate the QVariant value member for ValueTypeWrapperCopy. In fact, the entire class is folded into ValueTypeWrapper itself as d()->type has the one copy of the data. Change-Id: I0d9c794400095830540d313187623b98b686f4cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Fix value type wrapper class nameSimon Hausmann2014-12-235-76/+76
| | | | | | | | It's supposed to be QQmlFoo instead of QmlFoo. While all this code is being touched, we might as well fix the name. Change-Id: Ia8be0c6ec46e114f7559c1e7a07a9d368932999e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QQmlProperty to work correctly with deeply nested objects.Michael Brasser2014-12-232-1/+16
| | | | | | | | | | | | | | Don't keep reusing the top-level object to look up nested properties. This allows code such as the following to work correctly: PropertyChanges { target: myObject textChild.font.pixelSize: 24 } Change-Id: I39e52dbc20d2409fc756a36e668fcf664eb1905f Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Initial work on gadget supportSimon Hausmann2014-12-2216-456/+274
| | | | | | | | | | | | | | | | | | | | | | Changed built-in QtQml value types to use gadgets. This is in preparation for supporting external gadgets. This replaces the mostly direct inheritance of the concrete value types with gadgets and "dynamic" inheritance through QQmlValueType being generic. Over time as some of the value types may become gadgets, we can remove the ones here. It's important that these "separate" gadgets have the same memory layout as the actual types (QPointF, etc.). Also while QQmlValueType remains practically a singleton, it's not required anymore to be one. Consequently the JS wrappers for value types keep their own instance of QQmlValueType. This allows eliminating the qobject_cast in various places that dealt with the singleton nature. This comes at a cost, making the JS wrappers slightly heavier. However that is meant to be a temporary situation and finally the value type wrapper should merely store the meta-object in addition to the data and the type. Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add files generated by tests to gitignoreNobuaki Sukegawa2014-12-201-3/+11
| | | | | Change-Id: I1fac4df1e00cbe37c0c9ea69562dffc1eb4d5111 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Resolve type names inside guard property of SignalTransitionNobuaki Sukegawa2014-12-202-1/+103
| | | | | | | | | | | | SignalTransition's guard is evaluated against ad-hoc QQmlContext because it needs signal args added to its contextProperty. Since QQmlContext created this way does not have import type cache, we could not use type names inside guard. To avoid this problem, this patch makes guard's context inherit parent's type cahce. Change-Id: I4ddd559779681b53d4ee42f4820d05438addb5ac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Managed inherit ValueLars Knoll2014-12-2014-41/+33
| | | | | | | | This completes the first milestone towards being able to move objects across the GC heap. Change-Id: I8e6ce90254ea767188a31f0dc85b133534c87eb0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Property uses GC safeLars Knoll2014-12-2014-99/+108
| | | | | Change-Id: I5aa41a07a2d25e5c8a2d64bfa58a55fcd7aaf77e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Store a heap object in the qmlextensionsLars Knoll2014-12-202-6/+7
| | | | | Change-Id: I5ad9236378ff1e037945d024ee5bd6629dddec4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Store a pointer to a heap object in the context wrapperLars Knoll2014-12-202-4/+3
| | | | | Change-Id: I2555e3e78e429260129d83894ca94d158c5e1704 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use pointers to Heap object to avoid recursionLars Knoll2014-12-204-11/+13
| | | | | Change-Id: If491b35ba43758bd4792166f7213cd5a11d227d9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use Scoped values a bit more consistentlyLars Knoll2014-12-201-18/+17
| | | | | | | | Mainly cleanups, but also one or two potential places that could lead to issues with a moving GC. Change-Id: Ia388420052cd1a642120773f582bf21965830613 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Return a Heap object from the getter()/setter() methods of PropertyLars Knoll2014-12-205-27/+31
| | | | | | | | | | We actually need to put the returned value into a ScopedFunctionObject before calling it, as the Property could get deleted during the call leading to a dangling pointer. With a GC that moves objects this will become even more important. Change-Id: I43bece6f80eb3501c1291065846e230a59ae8aed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QQmlJS::Codegen: Short circuit in qmlErrors to avoid QUrl allocation costs.Robin Burchell2014-12-201-0/+5
| | | | | | | | This takes the time taken in qmlErrors for my (admittedly terribly morbid) testcase from ~104ms to ~1ms. Change-Id: I288086caa6e6b58f67e9feb6f1761c3310f01ead Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>