Robin Burchell [Tue, 6 Jan 2015 18:36:02 +0000 (19:36 +0100)]
qmltime: Correct module name in error message.
Change-Id: Icccad866bdbaf53bf2cb3f1aff30ecd9ff6d06a5
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Jocelyn Turcotte [Mon, 5 Jan 2015 17:14:56 +0000 (18:14 +0100)]
Fix the vertex ordering of merged triangle strips
Culling and gl_FrontFacing depend on the vertex order matching the
value set through glFrontFace. To match the default counter-clockwise
order we need to preserve the parity of triangles relatively to the
start of the indices argument of glDrawElements, but we break this
parity because of the degenerate triangles between merged strips.
Fix the issue by skipping the first degenerate triangle, the parity
of following strips will be preserved since they are then separated
by two triangles.
This fixes a regression of
tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml
triggered by
38cab579a0c5398b7621221fd8609bc43cf1f3c5.
Change-Id: Iefa7eaab68112d31be9d8646bd288eb000528cd5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Gunnar Sletta [Tue, 6 Jan 2015 07:40:21 +0000 (08:40 +0100)]
Reuse the memory we use for vertex uploads.
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>
hjk [Tue, 6 Jan 2015 09:35:32 +0000 (10:35 +0100)]
Some minimal changes to make qmlpuppet compile again
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>
Gunnar Sletta [Mon, 5 Jan 2015 12:21:45 +0000 (13:21 +0100)]
Remove bogus assert.
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>
Gunnar Sletta [Mon, 5 Jan 2015 11:38:18 +0000 (12:38 +0100)]
Traverse children correctly when reparenting.
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>
Albert Astals Cid [Fri, 19 Dec 2014 10:21:00 +0000 (11:21 +0100)]
Add propertyName to error
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>
Oleg Shparber [Wed, 31 Dec 2014 18:37:47 +0000 (10:37 -0800)]
Use QV4::ScopedObject typedef instead of actual type
Change-Id: I0b68c534ea513a7c230b12114f6b42b069f9864b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Oleg Shparber [Wed, 31 Dec 2014 18:40:16 +0000 (10:40 -0800)]
Use QV4::ScopedArrayObject typedef instead of actual type
Change-Id: I975536745ac6c264aca074f84d223fbec7682d3d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Oleg Shparber [Wed, 31 Dec 2014 18:43:46 +0000 (10:43 -0800)]
Use QV4::ScopedContext typedef instead of actual type
Change-Id: I71c6c9cf030e347fbc5e4073e9ca338a9ce95999
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Oleg Shparber [Wed, 31 Dec 2014 18:42:15 +0000 (10:42 -0800)]
Use QV4::ScopedFunctionObject typedef instead of actual type
Change-Id: I6b4effaa5bef992b4ae9402eea7fe655bc7b18f0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Oleg Shparber [Wed, 31 Dec 2014 18:34:52 +0000 (10:34 -0800)]
Use QV4::ScopedString typedef instead of actual type
Change-Id: I64ecbf6cea463387a70e909ecc5f9165d22a7b0f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Thiago Macieira [Fri, 19 Dec 2014 03:58:58 +0000 (19:58 -0800)]
Fix build: include <qdatastream.h> before using QDataStream
Change-Id: I779e0cd705f664368b47763d4367b9dc377c1770
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 14:52:06 +0000 (15:52 +0100)]
Remove unused variable
Change-Id: I399e66822f52e35d122d3a20bb8de20206e5864d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 14:31:09 +0000 (15:31 +0100)]
Add a direct accessor to retrieve the JS engine from the ExecutionEngine
Change-Id: I2617143e39f354657e12541f3796a583e9934118
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 14:21:16 +0000 (15:21 +0100)]
Reduce v8engine dependency in the type wrapper
Change-Id: I3a50aa3c0929c14ad856463635bf2fb2188f5c9f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 14:13:29 +0000 (15:13 +0100)]
Reduce v8engine dependency in qv4include
Change-Id: Idc50e7ed9e0de5c8742688c8493c2124075450ee
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 10:54:59 +0000 (11:54 +0100)]
Remove v8engine dependency in fromVariant conversions
Change-Id: I3427129dc7a0e68c8fa0b61f353835e2bee179a0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 10:39:53 +0000 (11:39 +0100)]
Remove v8engine dependency in toVariant conversions
Change-Id: I0f2f77c9cc268a0c5ca3ffe0cd66fc98bb1964b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Nobuaki Sukegawa [Sun, 14 Dec 2014 17:33:05 +0000 (02:33 +0900)]
Do not cause SegFault when importing empty javascript
Change-Id: I31f6571e73b5dd74bf3ade5cadc2daa02475b5cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Thu, 20 Nov 2014 09:42:34 +0000 (10:42 +0100)]
Enable gadget wrapping for custom value types
[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>
Lars Knoll [Tue, 30 Dec 2014 10:15:18 +0000 (11:15 +0100)]
Remove v8engine dependency from qv4serialize.*
Change-Id: I5b4c1247286bf18c96df3b68b7bae9feefbbdbc9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 09:59:43 +0000 (10:59 +0100)]
Don't store a v8engine pointer in qqmllistwrapper
Change-Id: I21b055deb74aafff8b2ee1cdce776e06f154dcaa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 30 Dec 2014 09:59:13 +0000 (10:59 +0100)]
Remove unused enum value
Change-Id: I1e1a34a974cea129fcf4513c0a163254d6c114cd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 1 Jan 2015 15:33:04 +0000 (16:33 +0100)]
Fix constructions of QJSEngine objects
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>
Oleg Shparber [Tue, 30 Dec 2014 22:11:59 +0000 (14:11 -0800)]
Make QV4::Value::isNaN() inline
Change-Id: Ia80d3b150822ec9b3965c981d58660567ca73ec1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Robin Burchell [Thu, 18 Dec 2014 11:43:18 +0000 (12:43 +0100)]
QV4::InternalClass: reserve space for transitions.
Profiling of allocations shows that this is one of the most frequent allocators.
Change-Id: Iae0350c61bfe37381577642b9a93064377f45c1d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 20 Nov 2014 08:07:52 +0000 (09:07 +0100)]
Make QQmlPropertyCache available in QJSEngine
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>
Simon Hausmann [Thu, 20 Nov 2014 07:56:36 +0000 (08:56 +0100)]
Prepare for QQmlPropertyCache to become available in QJSEngine
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>
Konstantin Ritt [Tue, 2 Dec 2014 15:33:39 +0000 (19:33 +0400)]
Fix build on MinGW
- alloca() needs malloc.h
- crtdbg.h couldn't be found on MinGW
Change-Id: Ibbf91a58d39ef1e2572baae3c409393acf7aa5df
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 19 Nov 2014 17:12:21 +0000 (18:12 +0100)]
Removed usage of QQmlValueType in QQmlValueTypeWrapper
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>
Oleg Shparber [Sat, 27 Dec 2014 07:13:54 +0000 (23:13 -0800)]
Make QV4::CallData::argument() method constant
Change-Id: Id2640f6a0c08069764baeac606a25fdb53b23419
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Tasuku Suzuki [Sat, 29 Nov 2014 16:40:42 +0000 (01:40 +0900)]
support XMLHttpRequest sync mode
[ChangeLog][QtQml][XMLHttpRequest] Supported synchronous requests
Change-Id: Ia38fcf97f212a14657bb519240d8406368a72390
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 14 Nov 2014 20:53:20 +0000 (21:53 +0100)]
Prepare method invocation in QObject bindings for gadget support
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>
Simon Hausmann [Fri, 14 Nov 2014 20:39:08 +0000 (21:39 +0100)]
Move methodParameterTypes and methodReturnType helper functions
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>
Simon Hausmann [Tue, 18 Nov 2014 18:21:07 +0000 (19:21 +0100)]
Reduce dependencies on QQmlValueType being a QObject
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>
Shawn Rutledge [Tue, 9 Dec 2014 09:41:47 +0000 (10:41 +0100)]
Photosurface example: scale and rotate the frame, not the image
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>
Simon Hausmann [Tue, 18 Nov 2014 17:41:45 +0000 (18:41 +0100)]
Further value type wrapper cleanups
Removed the QV8Engine * member in QQmlValueTypeWrapper.
Change-Id: I37cc131a3ff0279240b227c11a6b74bfc7bf4960
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 18 Nov 2014 16:28:40 +0000 (17:28 +0100)]
Begin cleaning up QQmlValueTypeWrapper
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>
Simon Hausmann [Tue, 18 Nov 2014 16:15:10 +0000 (17:15 +0100)]
Cleanup: Fix value type wrapper class name
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>
Michael Brasser [Fri, 12 Dec 2014 03:18:00 +0000 (21:18 -0600)]
Fix QQmlProperty to work correctly with deeply nested objects.
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>
Simon Hausmann [Mon, 10 Nov 2014 10:39:03 +0000 (11:39 +0100)]
Initial work on gadget support
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>
Nobuaki Sukegawa [Sun, 14 Dec 2014 17:57:45 +0000 (02:57 +0900)]
Add files generated by tests to gitignore
Change-Id: I1fac4df1e00cbe37c0c9ea69562dffc1eb4d5111
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Nobuaki Sukegawa [Sun, 14 Dec 2014 10:31:25 +0000 (19:31 +0900)]
Resolve type names inside guard property of SignalTransition
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>
Lars Knoll [Tue, 18 Nov 2014 20:22:44 +0000 (21:22 +0100)]
Make Managed inherit Value
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>
Lars Knoll [Mon, 15 Dec 2014 07:46:38 +0000 (08:46 +0100)]
Make Property uses GC safe
Change-Id: I5aa41a07a2d25e5c8a2d64bfa58a55fcd7aaf77e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 12 Dec 2014 11:35:52 +0000 (12:35 +0100)]
Store a heap object in the qmlextensions
Change-Id: I5ad9236378ff1e037945d024ee5bd6629dddec4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 11 Dec 2014 11:24:52 +0000 (12:24 +0100)]
Store a pointer to a heap object in the context wrapper
Change-Id: I2555e3e78e429260129d83894ca94d158c5e1704
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 11 Dec 2014 09:55:32 +0000 (10:55 +0100)]
Use pointers to Heap object to avoid recursion
Change-Id: If491b35ba43758bd4792166f7213cd5a11d227d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 3 Dec 2014 09:42:50 +0000 (10:42 +0100)]
Use Scoped values a bit more consistently
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>
Lars Knoll [Wed, 3 Dec 2014 09:42:07 +0000 (10:42 +0100)]
Return a Heap object from the getter()/setter() methods of Property
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>
Robin Burchell [Fri, 19 Dec 2014 19:45:55 +0000 (20:45 +0100)]
QQmlJS::Codegen: Short circuit in qmlErrors to avoid QUrl allocation costs.
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>
Lars Knoll [Tue, 2 Dec 2014 13:04:44 +0000 (14:04 +0100)]
Fix crash when setting proto to 0
Change-Id: Id0621c51466721c503f1a54156e21e1671a13561
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 2 Dec 2014 11:54:53 +0000 (12:54 +0100)]
Fix JSON stringification to work with heap objects
Change-Id: Ifbd7332602d67daa945da5ebbca797d0045aff68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 2 Dec 2014 11:46:20 +0000 (12:46 +0100)]
Fix Context::getPropertyAndBase to use Heap based objects
Change-Id: I4f885a8af5e963445959871b7f26f3bcb3dfa654
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 2 Dec 2014 11:23:49 +0000 (12:23 +0100)]
Fix comparisons between Object pointers
Change-Id: Icedbe32984b5b8bcb807411aa9945436b4bffca9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 2 Dec 2014 11:23:20 +0000 (12:23 +0100)]
Use a Heap::FunctionObject to store the thrower function
Change-Id: I6b3f03080f35e39d14b377363f7546a9f7260029
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 1 Dec 2014 15:13:20 +0000 (16:13 +0100)]
Remove most of the places where getPointer() is used
This is no longer required, and simply uglifies the code
Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 1 Dec 2014 14:53:41 +0000 (15:53 +0100)]
Fix wrong use of Scoped.getPointer()
Change-Id: I5e86afdd3f41055f653a6aa6a144371f6cb99806
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 1 Dec 2014 13:29:21 +0000 (14:29 +0100)]
Fix RegExpCache to store Heap Objects
Change-Id: I1613c438f5b862436790f81c6a3d370cfe78b6a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Nov 2014 13:02:06 +0000 (14:02 +0100)]
Store a Heap::EvalFunction pointer in the engine
Change-Id: I002eb8f94e168c9faf1ee3521170dfaf442af1a3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Nov 2014 12:25:56 +0000 (13:25 +0100)]
Fix the way we set the property name during iteration
This was broken due to the new inheritance scheme for Managed
Change-Id: Ia9df50e7e655c3a812a01a2c78945e648aa444dc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Robin Burchell [Fri, 19 Dec 2014 19:35:53 +0000 (20:35 +0100)]
QQmlJS::Lexer::scanNumber: Use a QVarLengthArray to avoid heap allocations.
This shaved the time of this function in half on an (admittedly very morbid)
testcase of mine, from 161ms to 72ms total.
Change-Id: I88ad8d4ad4791dc4e7eadb9af9265ff02fe5376f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Nov 2014 09:05:24 +0000 (10:05 +0100)]
Return Heap::ExecutionContext for globalContext()
Change-Id: Ide7c81735be4662ff45bf268cfe750ff1f784453
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Thiago Macieira [Fri, 19 Dec 2014 03:58:58 +0000 (19:58 -0800)]
Fix build: include <qdatastream.h> before using QDataStream
Change-Id: I623b9089f3d42bd2fe2a4c9e9119953dc3bfa1dc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Nov 2014 08:31:10 +0000 (09:31 +0100)]
Return Heap::ExecutionContext for currentContext()
Change-Id: I155ab996e24d7f36761d2ea62a04774e16469b34
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 17 Dec 2014 20:07:05 +0000 (21:07 +0100)]
Cleanup code that modifies the JS stack
Change-Id: Ic043e256c3df984bb06c9a16b86573b0173b19a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 19 Dec 2014 11:39:21 +0000 (12:39 +0100)]
Fix GC crash with conditional breakpoints and JS console
We may choose to execute an expression in a specific frame within the
debugger, which is where we pop context's until we reached the frame
in question. If we are trying to execute an expression at the top of the
stack (or with a conditional breakpoint expression), then we don't have
a frame and don't need to pop contexts. But also also don't need to call
Scope::alloc(-1).
Change-Id: I1f6754a3d77d943aed9bf4468e817a5269a3c547
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 15 Dec 2014 07:47:35 +0000 (08:47 +0100)]
Mark JS freed parts of the JS stack as undefined in valgrind
Change-Id: Ibee3d95762bc0a0124b65ad8986ed643b9535529
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 12 Dec 2014 14:29:22 +0000 (15:29 +0100)]
Fix valgrind support in the memory manager
Fix compilation and ensure the memory manager
doesn't create bogus warnings.
Change-Id: I78ccfc7a11944f3275b7c03f6005874a561fa977
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 27 Nov 2014 14:18:41 +0000 (15:18 +0100)]
Make ExecutionContextSaver GC safe
Change-Id: I29f00366d24c770afe4ba4579106d81a8c9043df
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Tue, 16 Dec 2014 12:44:14 +0000 (13:44 +0100)]
Replace usage of stdout for debug output by qDebug
This way even paranoid Androids can be show interesting stuff.
Task-number: QTBUG-43109
Change-Id: Ib0ef9e8f6c6fc66e9ea9bfcaf2cd9e33d7469070
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jocelyn Turcotte [Tue, 9 Dec 2014 15:32:48 +0000 (16:32 +0100)]
Allow batching ShaderEffects without atlas samplers
It is currently necessary to set supportsAtlasTextures to enable
batching of all ShaderEffect, even if they sample a
ShaderEffectSource or have no sampler uniform at all.
After
fccbe57258c10e18ccdbbec405f5522dbd97af66 it is not necessary to
set the RequiresFullMatrix flag based on supportsAtlasTextures since
this now prevents batching altogether. Limiting batching should
however also first verify that there are any sampler of the atlas
used on that ShaderEffect in QQuickShaderEffectMaterial::compare,
since that check wouldn't have any effect in
QQuickShaderEffect::updatePaintNode through RequiresFullMatrix.
Also make sure that using texture()->normalizedTextureSubRect()
as the texture coordinate attribute is synchronized with calls to
removedFromAtlas for all samplers and make sure that this only
applies when the texture count == 1. This fixes a bug where
setting supportsAtlasTextures on a ShaderEffect with more that
one sampler would incorrectly use the texture coordinates of the
first atlas texture in the geometry.
This patch also removes:
- The unneeded check for the RequiresFullMatrix in compare; the same
program can be used in batched geometries and the renderer itself
will prevent merging in that case.
- The possibly heavy string comparison of m_source;
QQuickShaderEffectMaterial::type() and QQuickShaderEffectMaterialKey
are doing that for us more efficiently.
I updated the documentation to clarify the 1-texture rule and
explain the difference with qt_SubRect uniforms and when one or
the other should be used.
Change-Id: I85a86b8e7cb76f1536d5fcd369c7889f22537846
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Laszlo Agocs [Tue, 16 Dec 2014 12:19:39 +0000 (13:19 +0100)]
rendercontrol example: calculate fbo size correctly
Change-Id: Ida1e7cb9426d31ed6406dd6db86f5834f0f1a6ac
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Jocelyn Turcotte [Fri, 12 Dec 2014 15:38:09 +0000 (16:38 +0100)]
Revert parts of "Fix the V4 valgrind integration"
Keep the MemoryManager as the pool argument of VALGRIND MEMPOOL
functions and access it through ExecutionEngine::memoryManager.
Change-Id: Iadb881ce8676088efe81870680aa75f6ba834248
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Tobias Koenig [Wed, 17 Dec 2014 12:51:55 +0000 (13:51 +0100)]
Fix handling of enum values encapsulated in QVariant
In case a QJSValue contains a QVariant which wrapps an
enum value, the valueOf() method will convert the enum
to an int32.
Change-Id: I0b92207184f343d53f73884245b90552165c34fc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Alain Martin [Tue, 16 Dec 2014 13:55:08 +0000 (14:55 +0100)]
Add -plugins argument to qmltestrunner to specify plugins search path
Allow users to specify locations of compiled QML plugins.
Change-Id: I66059dc7b1314ca6fbef87032b16ccf3caf8bd30
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Alain Martin [Tue, 16 Dec 2014 13:01:29 +0000 (14:01 +0100)]
Add -P argument to qmlscene to specify plugins search path
Allow users to specify locations of compiled QML plugins.
Change-Id: I0ad764282a7891013ce0cfa008a1cf8164cb083b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Lars Knoll [Thu, 27 Nov 2014 07:56:03 +0000 (08:56 +0100)]
Return a Heap::Object in Object::prototype()
Change-Id: Ice0265ae558ba14497421a5bbf25ee9db76adab5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Laszlo Agocs [Fri, 12 Dec 2014 11:18:08 +0000 (12:18 +0100)]
Update scenegraph docs regarding threaded render loop usage
Change-Id: I4f8aa9b209096bbcdabcb689007e4166279f8a4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Laszlo Agocs [Tue, 16 Dec 2014 11:56:00 +0000 (12:56 +0100)]
rendercontrol example: Add missing flushes
Otherwise we will show broken output with some drivers.
QQuickWidget does this already.
Change-Id: I5193595c4606d0497dbe85f6f8c670618ca366e9
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Robin Burchell [Tue, 9 Dec 2014 08:47:46 +0000 (00:47 -0800)]
Simple cache of url for QQmlCompiledData
Removes URL parsing and allocation/deallocation overhead as a bottleneck from
cached instantiation. Takes total runtime percentage of beginCreate from 6208ms
to 4987ms out of a 15 second trace of the instantiation_cached librarymetrics
benchmark with the empty Item data.
Task-number: QTBUG-43096
Change-Id: Ie4ec8e83461b4926e502dd78a7178cc8e8131e70
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Tue, 2 Dec 2014 10:57:41 +0000 (11:57 +0100)]
Allow batching of GL_LINES and GL_POINTS geometry
This is analogous to GL_TRIANGLES and GL_TRIANGLE_STRIP. There is no
reason why we shouldn't batch it. In the case of GL_LINES this means a
slight behavior change, though: If you provided geometry with an uneven
number of vertices, it would draw lines the way opengl specifies it and
drop the last vertex. Now, with batching, it will draw a line from the
last vertex of an "uneven" node to the first vertex of the next node.
This, however, is exactly like it already works for GL_TRIANGLES if you
specify a number of vertices not divisible by 3. We assume the user
should specify a number of vertices that matches the drawing mode.
Change-Id: I372b9c15a19f065d3aeb3727688cca408ce9608e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Shawn Rutledge [Thu, 11 Dec 2014 12:55:02 +0000 (13:55 +0100)]
fix the build with -no-qml-debug
The "cleanup" variable doesn't exist in this case.
Change-Id: Ia7ed654d5c9ae57bc3f7cff39acbd72214ff4188
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Simon Hausmann [Fri, 14 Nov 2014 07:08:32 +0000 (08:08 +0100)]
Simplify QFont value type wrapper in preparation for gadgets
The value type wrapper for QFont tries to keep track whether pixel or point
sizes were set and warns the programmer accordingly if both were set. This is
implemented using separate boolean variables, but this can also be done using
QFont's resolve mask.
This move is motivated by the ability of the value type wrappers to operate
only on the type they wrap in the future, without requiring additional
helper variables.
Change-Id: Ia05093b5dcc950281ef89b2bb6fe96c18329cdfa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Mitch Curtis [Mon, 1 Dec 2014 13:37:09 +0000 (14:37 +0100)]
Read and write QObject pointer properties in QML without registration.
Previously, accessing QObject pointer properties from QML would require
these types to be registered with qRegisterMetaType(), but this
shouldn't be necessary if we're able to read/write the property, because
the moc generates code that calls qRegisterMetaType in the static meta-call
implementation. So when resolving a property in the property cache and we
can't resolve, fall back to placing the static meta-call to register the
type, similar to what QMetaType::userType() does.
Change-Id: Ic8b00ed93a1e5e42cf7aaaf1c355e89557485c59
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Simon Hausmann [Fri, 14 Nov 2014 15:12:14 +0000 (16:12 +0100)]
Simplify calling methods on value types
We don't need to go deep through the QObject wrapper, we can use QObjectMethod
directly after we've determined a Q_INVOKABLE property.
Change-Id: I2a8e3e827991a365758dd106d2ba92a1bd0d7aab
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Ulf Hermann [Fri, 12 Dec 2014 12:50:30 +0000 (13:50 +0100)]
Document behavior of JavaScript Date with negative years
Task-number: QTBUG-29491
Change-Id: Icc9620abc3bc606f1cd0ab89762f370ac259893e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Simon Hausmann [Wed, 19 Nov 2014 15:56:40 +0000 (16:56 +0100)]
Fix QQmlPropertyCache population with gadgets
The property cache excludes the destroyed() signals as well as the deleteLater()
slot from the accessible methods. It does that by comparing the method index
against the indices of these signals/slots, which works as long as every
meta-object is through some way derived from QObject's meta object. However
that's not the case for gadgets, where these indices don't apply and
will instead accidentally hide methods.
Change-Id: I5f2b3f578192ff0df607af67832389c30bb11beb
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Ulf Hermann [Thu, 11 Dec 2014 13:05:31 +0000 (14:05 +0100)]
Revert "Properly handle negative years when printing JS Dates to strings."
This reverts commit
f06daaf3d8747c6c0a277bf055c80d8f2e7bcc81.
The only things actually specified by the ECMAScript standard on dates
are:
1. Reparsing a date output from any of the to*String() functions has to
result in the same date representation.
2. The ISO 8601 standard has to be followed for the ISO format.
Currently we clearly don't follow rule 1. Date.parse(d.toString()) will
not yield the same as d.valueOf() for negative dates.
The ISO 8601 standard clearly has a year 0 while common human language
has not. All non ISO date representations are considered
"implementation-dependent" in the ECMAScript standard. We can thus
define the relation between our representations and the ISO standard any
way we like. If we try to match up the dates so that the negative years
look equal in each representation we cannot properly interact with QDate
for dates in the year 0 as that doesn't exist in QDate. We can, however,
choose not to make the dates look equal. That means a date with a
negative year will be "one off" when represented in ISO 8601. "333 BC"
in human language is "-332" in ISO 8601. Our internal representation is
aligned to ISO 8601 and the to*String() methods may output something
else. That means we can easily set the year in ISO 8601 sense from the
Date constructor as well as from setYear() and setFullYear().
This, of course, is somewhat unintuitive and also differs from most
other JavaScript implementations (which don't have to interoperate with
QDate). However, it is still correct.
Change-Id: I5fc26b709a486cb520a075918b184a80bec56c9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Laszlo Agocs [Tue, 25 Nov 2014 10:38:46 +0000 (11:38 +0100)]
Support threading with QQuickRenderControl
Reorganize the rendercontrol example to demonstrate both the single
and multi threaded approaches.
A small helper function is introduced to the QQuickRenderControl API:
The QSGRenderContext has to live on the render thread. Previously there
was no way for applications to move it to the desired thread. This is
now possible.
Pass --threaded to the rendercontrol example to use a separate render thread.
[ChangeLog][QtQuick] QQuickRenderControl can now be used to render the Qt Quick
scene on a dedicated render thread, similarly to how the built-in threaded render
loop operates.
Task-number: QTBUG-42813
Change-Id: I01c3b2ffca8a174d9d2c267a51f2e484ed7b34b3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Jocelyn Turcotte [Fri, 12 Dec 2014 10:41:21 +0000 (11:41 +0100)]
Fix the V4 valgrind integration
87a055bc8eee653a18d51f94a546cd452732223a broke the build and
introduced invalid writes to chunks outside of the existing
VALGRIND_DISABLE_ERROR_REPORTING block.
Fix the build by using MemoryManager::Data* instead of MemoryManager*
as the pool argument to VALGRIND MEMPOOL calls since the Data pointer
is protected.
Change-Id: I24136e25291570ade825dcd84a9568d8169a235b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Laszlo Agocs [Sat, 22 Nov 2014 19:47:07 +0000 (20:47 +0100)]
Default to threaded when using opengl32
This appplies only when using opengl32.dll. When using ANGLE or
when using another non-opengl32 DLL, the "windows" single-threaded
loop is chosen, just like before.
One badly written autotest is fixed. We must never assume that
performing some QQuickWindow related work will leave a context
current on the main thread. The assumption worked by accident with
the single-threaded render loop.
[ChangeLog][QtQuick] Changed to use the threaded render loop by
default on Windows when running with desktop OpenGL (opengl32.dll).
Change-Id: I21798622c19ca510a97a96c19c1e70e29f086e3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Simon Hausmann [Tue, 9 Dec 2014 11:26:59 +0000 (12:26 +0100)]
Remove QML bundle code
This feature is effectively not maintained, experimental and undocumented.
Consensus on the mailing list is to remove it:
http://lists.qt-project.org/pipermail/development/2014-December/019384.html
Change-Id: Iaa73b3e90806c338ef81bbd4307ddd2addd37964
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Oleg Shparber [Fri, 28 Nov 2014 08:20:29 +0000 (00:20 -0800)]
Add default parameter value for ExecutionEngine::newString()
Change-Id: I8efbfb07ea61e2c6d03eeb79671006d209e4d48e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Oleg Shparber [Fri, 28 Nov 2014 09:19:11 +0000 (01:19 -0800)]
Add default parameter value for ScopedCallData()
Change-Id: I16b6662a47c682e145d3e2201f9e90f58405a599
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jocelyn Turcotte [Wed, 3 Dec 2014 16:25:11 +0000 (17:25 +0100)]
Release the VM of unused heap chunks
This changes the way that available items are linked together to
allow releasing chunks not containing any inUse item after being
swept. Instead of putting a freed item at the top of the stack and
make it link to the item previously at the top, relink all
items !inUse to point to the previously visited unused item during
sweeping.
This allows any chunk to be released in the process while making sure
that no previous or next item will link to an address in that chunk.
The performance penality of relinking the list has been measured
to be ~0.6% with v8-bench.js tst_QJSEngine::largeSweep. In exchange,
this helps keeping the amount of chunks to sweep lower after peaks
of heap allocation, even though that ability will be restrained by
heap fragmentation in long running applications.
Task-number: QTBUG-41099
Change-Id: I81a70f0a930b679a1bef47e630b23dab5f6d1218
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 24 Nov 2014 14:38:41 +0000 (15:38 +0100)]
Move prototype back from the vtable into Object
This is the only way we can support a GC that moves
objects around in memory.
Change-Id: I1d168fae4aa9f575b730e469e762bc5b5549b886
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Nov 2014 12:18:23 +0000 (13:18 +0100)]
Better encapsulate access to the global object
Change-Id: I8a76112d821cb3fc172ba0d16ee8410d39b4422a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Nov 2014 08:17:01 +0000 (09:17 +0100)]
Encapsulate accesses to the root context
Change-Id: I668cef1363a5c1a5c5b9a7e138f3bd0338712eea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>