Commit Graph

12243 Commits

Author SHA1 Message Date
Ulf Hermann 901b975fb5 V4: Don't pass size and pointer through allocation trackers
By not relying on the return value of the macros we can #define them
away later, when compiling with -no-qml-debug

Change-Id: I24d50fa3f5d8e8765a42b050c81ddfae20f20a23
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 11:03:25 +00:00
Ulf Hermann c685165038 Qml: Create profiler adapters in the plugins
This way QtQml doesn't need to know the ctors.

Change-Id: Ie74049092b5eb9837537591c0cf37ad1487e4066
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 11:03:22 +00:00
Ulf Hermann bd48f0e5ed Tooling: Convert connects to Qt5 style
Change-Id: I6746b777f73d047f5cf610bfca9b320ac1e13676
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-28 09:17:49 +00:00
Ulf Hermann b096d9e4e7 QmlDebug: Inline most of QQmlDebugService
The compiler might be able to optimize better if it knows the methods
are empty.

Change-Id: Ib730e857d1ab948bb2f5c5006f4911d2e6db282d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-27 16:04:24 +00:00
Ulf Hermann 40ada6f8c8 QML: Remove QQML_NO_DEBUG_PROTOCOL
There is no sane way to set this.

Change-Id: I5f7b70d1947d469dd01a1454180f01ad0d1c099d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-27 16:03:51 +00:00
Ulf Hermann 40c16d1515 V4: Remove empty file
Change-Id: Ibae2334336f5cc4f16cd9c9d8d142ea4b013462b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-27 16:03:31 +00:00
Ulf Hermann ffdf0ed0f8 Don't needlessly look up debug services
Change-Id: Idcca82b85e07ca0a8a9a2f370af90403bc4342c7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-27 16:02:26 +00:00
Ulf Hermann 3934ae38cd Remove some dead code
Change-Id: I1fa95d3c91e7f3ad5f2bf8f9d732ef72b74a98c8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-27 16:01:57 +00:00
Andy Nichols c809e56591 Software Adaptation: Fix issue with clip node handling
Under certain circumstances the clip node state would not get
propagated properly to child nodes.

Change-Id: I6f34690c7cc6f2837854fbcaff9aa4d7522e47c3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-27 11:01:24 +00:00
Andy Nichols 6129f48e4a Software Adaptation: Add threaded render loop
This is a new attempt at providing a threaded render loop for the
software adaptation in scenegraph.  This approach is modeled after the
D3D12 backend, and provides a separate thread for each window.  To
enable use the environment variable QSG_RENDER_LOOP=threaded as with the
other backends.

Change-Id: I6932975dd9c5579d36f0135aa4626dcc43b45ecd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-27 09:13:44 +00:00
Ulf Hermann 0ed6f80544 Move QQmlMemoryProfiler to debugger directory
Change-Id: Ia1b1038a684f6ec34af777090d4d21021eac01f1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-26 07:52:49 +00:00
Ulf Hermann 56c39ee55d Don't set QT_QML_DEBUG_NO_WARNING on -no-qml-debug
It won't work anyway.

Change-Id: I2bc8f6b1b72cf30f0314ad551838db4f04c11297
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-26 07:52:42 +00:00
Ulf Hermann e94aa8154b Remove some unnecessary includes
Change-Id: I18f2b6f44decf5ecde45e20722541b9a18d60b16
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-26 07:52:38 +00:00
Ulf Hermann 530b1f145d QmlDebug: Fixes for QQmlDebugConnection
Properly close the connection on invalid hello messages and implement
flush() also for local sockets.

Change-Id: Ie78441b9933c6de053962a11b5d7e2636792a31c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 12:08:55 +00:00
Erik Verbruggen 42f6af4781 QML: Clean up and re-order QQmlPropertyPrivate::write
The most common cases of property writes now come first.

Change-Id: I225b73746120870d9ca01d09983ad225e32bd99c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 11:55:52 +00:00
Nikita Krupenko dbb56ab74a Expose HSV and HSL color values to QML
[ChangeLog][QtQuick] Added properties to access color values for the HSV
and HSL color models to the basic QML color type.

Task-number: QTBUG-48723
Change-Id: I45fa52f9f3878553e1b3d0a34b47804ede7794f8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-07-25 09:31:04 +00:00
Erik Verbruggen 007ae316a6 QML: Unify property reads/writes and use accessors
Pass property reads/writes through utility functions in QQmlProperty,
which in turn will try to use accessors when available (and no
interceptors have to be called).

Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-25 09:26:38 +00:00
Simon Hausmann 4c1a51006e Improve robustness of qml disk caching
Perform various basic checks before proceeding to load an existing cache file,
including the qt version, architecture, data structure version and others.

Change-Id: Ie822b056e944ac120643aad260e97f62616688bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-07-23 05:18:59 +00:00
Thiago Macieira 8a8b826cad ICC: suppress the warning about -fno-delete-null-pointer-checks
Recent qtbase updates set QT_GCC_MAJOR_VERSION even for ICC.

Change-Id: I149e0540c00745fe8119fffd1463d34701f370f3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-23 05:18:49 +00:00
Thiago Macieira c3a8f7b0eb Fix ICC change-of-sign warning
INT_MIN is negative.

qv4assembler_p.h(108): warning #68: integer conversion resulted in a
change of sign

Change-Id: I149e0540c00745fe8119fffd1463d31acd727690
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-23 05:18:35 +00:00
Edward Welbourne 6c630da50d V4 CompilationUnit: missing #include for date-time comparison
MinGW's cc got upset at a QDateTime comparison when it only had a
forward declaration of the type.

Change-Id: I0404248cbdfc35610d8465294534bd5201dcf2a2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-21 15:18:38 +00:00
Simon Hausmann a6b2c5100a Add support for saving/loading the moth interpreter byte code
With the JIT and moth supporting persistence, we can enable the disk
cache tests unconditionally.

Change-Id: I6d6652411237001433a32a2de21d1f78f51b43ef
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-21 04:55:52 +00:00
Simon Hausmann e4aaa3845c Prepare moth bytecode for serialization
When using the threaded interpreter, don't produce the instruction handler
addresses right away but perform that as a separate step when linking against
the engine.

Change-Id: I216100f8b99f45eb8d954c733ac128e83aa6da38
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-21 04:55:47 +00:00
Mitch Curtis aa5f09a0d2 Add tryVerify()
This is useful for conditions which can't be tested using tryCompare.
One such situation is that of the currentItem property of ListView.
In Qt Quick Controls 2, the currentItem property of the ListView that
is internally a child of Tumbler can be null for a certain period of
time, so using tryCompare() would result in errors due to trying to
access a property of a null object:

    tryCompare(tumblerView.currentItem, "text", "2")

The current workaround is to use wait(50) in a for loop, which is ugly
and could lead to flaky tests:

    for (var delay = 1000; delay >= 0; delay -= 50) {
        if (tumblerView.currentItem)
            break;
        wait(50);
    }
    verify(tumblerView.currentItem);
    compare(tumblerView.currentItem.text, data.currentIndex.toString());

Using tryVerify(), we can first ensure that currentItem isn't null, and
then use a regular synchronous compare afterwards:

    tryVerify(function(){ return tumblerView.currentItem; });
    compare(tumbler.currentItem.text, data.currentIndex.toString());

[ChangeLog][QtTest][TestCase] Added tryVerify() function to allow
verification of asynchronous conditions that can't be tested using
tryCompare().

Change-Id: Ie93052b650f7fe0bf26853054a8f0f35a483e387
Task-number: QTBUG-19708
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-20 07:55:27 +00:00
Simon Hausmann 877ce4d446 Add support for caching of .js files imported from QML sources
This requires only minimal changes.

Change-Id: I89e16bad97bf26669f8e4f4336ac6d32e5027c35
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 18:20:02 +00:00
Simon Hausmann ffebff97a9 Simplify reference management in QV4::Script
There's no apparent need to store the refptr to the compilation unit in a
persistent value, when the persistent's life time is bound to the life time of
the V4::Script.

Change-Id: Ib4f3008f45c17a680dbe12ca1f80522fd7f6fdfc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 18:19:57 +00:00
Simon Hausmann 6a1667bc4e Improve robustness of qml cache expiry checking
Instead of relying on two time stamps in the file system (source file and cache
file), make the determination on whether the source file is newer than the
cache solely depend on the time stamp of only the source file. This means that
when cache files are stored in archives for example their modification date
does not need to be preserved upon extraction.

Change-Id: I0b4362663868c6fb9bd7e106028161b2d67274d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 18:19:46 +00:00
Simon Hausmann e0e50532d2 Added basic loading of compilation units from disk
This remains hidden behind the QML_DISK_CACHE flag until all backends
support it and the verification code is in place.

Change-Id: Ic77c64e20a2dc4c43473c47640e09f8070237e85
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-19 14:50:02 +00:00
Erik Verbruggen fa06494d88 QML: Fix check when to use accessors
The bit indicating if accessors could be used only returned true when an
interceptor was added to the object, but the property in question was
not intercepted. So it missed the case where no interceptor was
installed on any property of the object.

Change-Id: I355eb7bbe232f512d02c1b9783a0e6f990552689
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-19 12:32:54 +00:00
Erik Verbruggen ac326046e1 QML: Fix property notifier registration for constant properties
Constant properties typically do not have change notification signals,
so do not attempt to listen to those.

Change-Id: I4b3622d014aa2f8b3794a63f78ada9806c53966b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-19 12:32:48 +00:00
Laszlo Agocs f743fc8fee D3D12: clean up logging
Make QSG_RENDERER_DEBUG more fine-grained, the maximum set is now
loop;build;change;render;descheap;buffer;texture;shader meaning "render" is
broken up into 5 categories.

Fix also a comment on the root signature to avoid future headache with
trying to optimize the descriptor table for textures away (in vain).

Change-Id: I06a2a624ed39aaf5de42b8e984a192c7966360ab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-19 11:48:15 +00:00
Andy Nichols 764ca4053d SoftwareImageNodes: Support textureFiltering and mirroring
Missing features in the QSGImageNode based software node.

Change-Id: If6a759873d201307e013a3ab019bd906d98ba7d5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-07-19 10:41:01 +00:00
Laszlo Agocs 4cb2552313 software: Add support for QSGRenderNode
Have to change getResource() a bit since it turns out it is not suitable
currently for backends that do not have a per-window rendercontext and do
not implement the interface on the rendercontext. Pass in the window to
make sure it can always figure out which window we want the resources for.
(we do not want rendererInterface() to return window-specific instances
created on the fly, with ownership issues, so stick with the simple model
where backends implement the interface on one of their existing classes)

To support clipping, QSGRenderNode::RenderState is extended accordingly.
Also updated the docs since some claims in the rendernode docs are not true
since Qt 5.3.

Change-Id: I34779c83926f5231b888fcab7131e873ae97964f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-19 10:40:55 +00:00
Frederik Gladhorn b4fc940978 Stabilize tst_QQuickView::resizemodeitem
FAIL!  : tst_QQuickView::resizemodeitem() Compared values are not the same
    Actual   (sizeListener.at(i)): QSize(80x100)
    Expected (view->size())      : QSize(200x300)
    Loc: [tst_qquickview.cpp(172)]

The "SizeChangesListener" can be instantiated too early, catching
signals from the previous resize events. Make sure to flush all events
before.

Change-Id: Ib0933429f5c589f120c263619f00893fa813e361
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-19 09:25:28 +00:00
Frederik Gladhorn 9dc4085e59 Remove redundant compare in test
The same condition is tested in the line above.

Change-Id: I99720e3603b1ae5e2f5161696f1de3dd03f6ff50
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-19 09:24:46 +00:00
Simon Hausmann 7605b92573 Fix compilation
Commit be491913c0 regressed the build with some
compilers that complained that the RegExp fields were uninitialized. Fix is
the same as for the Lookup class.

Change-Id: Ie6b2adf14496d75845f6a9d9b8fc680e61aa1155
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-07-19 08:52:39 +00:00
Laszlo Agocs 12461f7df2 D3D12: Move swapchain/color buffer format to a constant
So it can be changed to BGRA, if desired, although tests show that BGRA
reduces perf a little bit in fact.

Change-Id: Ieb87bba2298426f1503658f8dffb0c659c265ca5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-19 06:51:18 +00:00
Laszlo Agocs a0dd740090 D3D12: Show a warning when the requested adapter is not usable
Change-Id: I3cbc4bf45b22f8bf772163be24ca4c9ccb63fcad
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-19 06:51:14 +00:00
Shawn Rutledge b845b6560d move QQuickCloseEvent from qquickwindow_p.h to qquickevents_p_p.h
It seems to be the same sort of persistent event for exposure to QML.

Change-Id: I4ebc48422ee517f37e300629b6d100f68b9703b3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-07-15 23:03:49 +00:00
Simon Hausmann 8f19045ef5 Split out creation of alias properties in the property caches
Similar to the regular property cache creation code, this also has to become a
template function so that it can be run on the compilation units loaded from
disk in the future. What is shared between the code path of a fresh compilation
vs. re-use of a unit from disk is the code to propagate the CompiledData::Alias
entries into entries in the property cache. The code for iterating through the
component spaces and resolving the alias references is not shared.

Change-Id: I04c2a5575310400156b457ae7b709cffecb7455e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 20:31:51 +00:00
Simon Hausmann bf5f97e6c6 Fix alias resolution algorithm
The resolution of aliases needs to to be solved in iterations as an alias can
refer to another alias, which may not be created yet in the property cache by
the time we try to perform the resolution. Therefore the alias resolution code
works off a list of pending aliases after the initial pass of resolution. This
also requires the ability to detect circular references.

Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-07-15 18:51:39 +00:00
Laszlo Agocs f1736b9a94 D3D12: Change the command list size limit
128 is way too low. Experiments with qmlbench show that there is not much
improvement after 4000 so go with 4096.

Change-Id: I1fd8f4f55250b5e54d95adb28b4ea1f4fe5ca10a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 18:03:58 +00:00
Laszlo Agocs bc2a25dfc1 Make scenegraph plugin logs and warnings work in release builds
Ifdefing with no_debug_output is a bad idea in this case, these are
messages we want in any builds.

Change-Id: Ic842afe9b48961fb7fb010db868f92f8e85184c3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 18:03:46 +00:00
Laszlo Agocs 0308a8379b Improve the frameSwapped docs somewhat
"frame buffers have been swapped" is a bit underspecified and is quite
confusing outside the EGL/GLX/WGL world.

Change-Id: Ib4b267c0b74a101e78b9368556d80aeee6ccbc4b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 18:03:37 +00:00
Laszlo Agocs 592286d109 D3D12: Enhance the advanced config section in the docs
Change-Id: If8531f1b7ed10085fee77c7f1c7d9f3976a10817
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 18:03:28 +00:00
BogDan Vatra 0ce892a275 Android: Fix crash
Make sure all the sturcture fileds are aligned

Change-Id: I6f6dad67262e50026f7e86320bcd818a478ebc35
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-15 14:39:19 +00:00
Erik Verbruggen 96cc0d7b4c QML: Allow for inlining InternalClass::find
This method is used in ExecutionEngine::getProperty, which is called
quite often.

Change-Id: Ide49d158005ef1d9f51d1e734cf9e3b19f52cf26
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-07-15 10:32:45 +00:00
Laszlo Agocs 0c43995e94 D3D12: Fix unused var warnings in release builds
Change-Id: I83c3582ca7cb9523fb0e90627f2575992e84694c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 09:38:54 +00:00
Laszlo Agocs cba3780413 D3D12: Mention QQuickWidget in the docs
Change-Id: I778003c4110e825dc77aafff64f255ba4c9d7056
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 09:30:40 +00:00
Laszlo Agocs f3200a1f97 software: Fix potential infinite loop with ShaderEffect
With the software backend we entered an infinite loop when having
ShaderEffect items. The previous change introducing the usage of polish
requests to defer shader processing was a bit too keen on trying over and
over again: there is exactly one retry attempt we need, not more. If the
second fails too and everything looks initialized and ready, then we know
the backend has no shader effect support so it is futile to try again.

Change-Id: Ibaaefd45e5b26d0be42dbe7f9c080363b7a939bf
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-07-15 09:30:37 +00:00