platform/upstream/qtdeclarative.git
10 years agoAlso fix the unused variable warning that ICC found with Clang
Thiago Macieira [Fri, 3 Jan 2014 23:08:15 +0000 (21:08 -0200)]
Also fix the unused variable warning that ICC found with Clang

The ICC fix happened on e02cb2b31ab0b171f11d278305d9f532f005bc80. This
now fixes for Clang 3.4:

cached-powers.cc:134:18: warning: unused variable 'kCachedPowersLength' [-Wunused-const-variable]

Change-Id: I876d9d5cf43fb7eb76117d6fdc37265295c360df
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoQtQuick.Dialogs FileDialog: default mode is ExistingFile
Shawn Rutledge [Mon, 30 Dec 2013 15:55:41 +0000 (16:55 +0100)]
QtQuick.Dialogs FileDialog: default mode is ExistingFile

Previously did not sync the mode with the state of the selectExisting
property on construction.

Task-number: QTBUG-35877
Change-Id: Ifb630fb51c463025ec2f6a1932714f354552c234
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoFix property access to QQmlPropertyMap objects when addressed via id
Simon Hausmann [Thu, 2 Jan 2014 11:17:31 +0000 (12:17 +0100)]
Fix property access to QQmlPropertyMap objects when addressed via id

Property access to id objects is optimized at compile time, but we cannot do
that for QQmlPropertyMap instances (or generally fully dynamic types).

This issue was a regression against Qt 5.1

Task-number: QTBUG-35906
Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix lookups of enums in singletons
Simon Hausmann [Thu, 2 Jan 2014 07:48:55 +0000 (08:48 +0100)]
Fix lookups of enums in singletons

This is a regression against 5.2.0 (which didn't have this bug), due to
optimizations introduced in the stable branch after the release. The code path
for optimizing access to the members of C++ based singletons through the
regular meta-object properties would end up excluding access to enums when the
lookup happens at run-time. The run-time getter for the singleton itself would
return a wrapped QObject instead of a QQmlTypeWrapper, and only the latter
includes enums.

As QML based singletons (composite singletons) cannot declare enums, we can
continue to do fast lookups on these, but otherwise have to fall back to the
slower code path.

Task-number: QTBUG-35721

Change-Id: Icc66bdaf3572622cdb718f82b706e3204afa0167
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: remove class field in DominatorTree that was used only once.
Erik Verbruggen [Wed, 18 Dec 2013 10:34:17 +0000 (11:34 +0100)]
V4: remove class field in DominatorTree that was used only once.

Calculation of all the children of nodes in the dominator tree is now
calculated as a local variable right before computing the dominator
frontier. The effect is that they are not retained after their only use.

Change-Id: I83c962c691b78cb767708eb04cf30d3b7a760deb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: do not add unconditional jumps to work lists
Erik Verbruggen [Tue, 17 Dec 2013 11:44:07 +0000 (12:44 +0100)]
V4 IR: do not add unconditional jumps to work lists

Both type inference and the optimization pass do not do anything with
unconditional jumps. So, instead of adding them to the worklist and
later on removing them again, it’s faster to never add them in the first
place.

Change-Id: Ib81d43e9ea6df2b1a70e9dd1e9b9c29cb6d345d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: re-enable test cases disabled for QTBUG-34047
Erik Verbruggen [Tue, 17 Dec 2013 11:30:11 +0000 (12:30 +0100)]
V4: re-enable test cases disabled for QTBUG-34047

Task-number: QTBUG-34047

Change-Id: Idcce254f3594e1f7021705704dbe6a2330aa7e65
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: change datastructures for dominator calculations.
Erik Verbruggen [Mon, 16 Dec 2013 15:45:59 +0000 (16:45 +0100)]
V4 IR: change datastructures for dominator calculations.

Replace hashes from basic-block to basic-block with vectors that
associate basic-block index to basic-block index.

Change-Id: I834ea3d825e4d2b02c075b1b0f080f5a65f41317
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
10 years agoDoc: Fix broken links
Sze Howe Koh [Mon, 30 Dec 2013 04:15:09 +0000 (12:15 +0800)]
Doc: Fix broken links

Change-Id: I4c4577edde96978a986606bf30fbb925f871bd42
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoQtQuick ColorDialog: ensure slider rotation takes effect
Shawn Rutledge [Thu, 12 Dec 2013 07:54:22 +0000 (08:54 +0100)]
QtQuick ColorDialog: ensure slider rotation takes effect

Task-number: QTBUG-35206
Change-Id: Ia6b4f743cd9bea937eb891ddd16776f975d42bcd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoQtQuick.Dialogs: check for inheriting from QApplication
Shawn Rutledge [Fri, 27 Dec 2013 16:16:47 +0000 (17:16 +0100)]
QtQuick.Dialogs: check for inheriting from QApplication

Widget-based dialogs are allowed if the application is a
QApplication, but subclassing is OK too.

Task-number: QTBUG-35769
Change-Id: Iec329792d7c1d85adcb1c3542444f0e92792b20b
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoContext2D: don't use an arrow to illustrate scaling in the docs.
Mitch Curtis [Tue, 17 Dec 2013 09:05:42 +0000 (10:05 +0100)]
Context2D: don't use an arrow to illustrate scaling in the docs.

The example image scales an arrow, but uses an arrow to indicate that
the next image (an arrow) is a result of the first arrow being scaled.
Instead, use a circle.

Change-Id: I8de18d4c2f3cb309681f63c31b0c9f7255d1868c
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
10 years agosystemdialogs example: path to /tmp is different on Windows
Shawn Rutledge [Thu, 12 Dec 2013 09:21:29 +0000 (10:21 +0100)]
systemdialogs example: path to /tmp is different on Windows

Task-number: QTBUG-34100
Change-Id: Ic06ed2933b76704b1a298de826cbe6b8587fee76
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoDoc: Fixed a few broken links and snippets
Venu [Thu, 19 Dec 2013 12:25:07 +0000 (13:25 +0100)]
Doc: Fixed a few broken links and snippets

Couple of \snippet references in the ListModel docs
were pointing to files outside the exampledirs boundary.
Update those references to use the relative path.

Change-Id: Ibf9d0fda9e5280345b08cb66a4fe0db9142a42a6
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoQtQuick docs: add missing \qmlpropertygroup commands
J-P Nurmi [Wed, 18 Dec 2013 16:45:52 +0000 (17:45 +0100)]
QtQuick docs: add missing \qmlpropertygroup commands

"warning: No QML property group command found; using..."

Change-Id: Iafbdbc09cbd76bf81a5baf3a5a4fab843778b5cb
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoDoc: Updated the image URL
Venu [Mon, 16 Dec 2013 15:02:09 +0000 (16:02 +0100)]
Doc: Updated the image URL

The existing HTTP url for logo.png was automatically
redirected to an HTTPS url which fails without SSL. So
updated the example to use different HTTP url.

Also updated another image URL, which is invalid now.

Task-number: QTBUG-35557
Change-Id: I793fc5ebda64b21f443da7db9ecda76ae951d5bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agouse private linkage where possible
Oswald Buddenhagen [Thu, 31 Oct 2013 12:38:33 +0000 (13:38 +0100)]
use private linkage where possible

Change-Id: I1f51b7d043f49f2f2849eb370ac71366cbaa6da5
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoremove obsolete workarounds for qmake processing order problems
Oswald Buddenhagen [Thu, 31 Oct 2013 12:38:23 +0000 (13:38 +0100)]
remove obsolete workarounds for qmake processing order problems

Change-Id: I4b58eee6243c92f67bdd9c8f9da36ef82a489c12
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoV4 SSA: add some more literature references.
Erik Verbruggen [Mon, 16 Dec 2013 13:38:45 +0000 (14:38 +0100)]
V4 SSA: add some more literature references.

Also fixed some comments.

Change-Id: I4aedff84bdbf8de248025bc48805a859704bdd8a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix deadlock when QQmlEngine is destroyed during compilation.
Andrew den Exter [Fri, 13 Dec 2013 06:10:58 +0000 (16:10 +1000)]
Fix deadlock when QQmlEngine is destroyed during compilation.

Before blocking to wait for the thread to finish ensure the thread
itself is not waiting for the main thread to complete some action
otherwise both threads will be waiting on the same wait condition that
neither is able to wake.  Likewise ensure the shutdown action is
processed if the last scheduled event is currently being processed.

Task-number: QTBUG-35581
Change-Id: I483fc56d0d398493f9fa907f3ab203439bfb9221
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix positioning of item when first cacheBuffer item is removed.
Andrew den Exter [Mon, 23 Sep 2013 06:30:40 +0000 (16:30 +1000)]
Fix positioning of item when first cacheBuffer item is removed.

When items prior to the first visible item are removed from the instantiated
items list the first item is moved forward by the size of the item removed so
it position remains correct relative to the visible items.  But if the removed
item is the first instanitated item then it's size shouldn't contribute to the
offset as the next instatiated item is already offset by its size.

Task-number: QTBUG-33619

Change-Id: I05c33f505e2856afa08cd9cd89d8eae97c20679d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoQtQuick window example improvements: window size and DPI info
Shawn Rutledge [Mon, 16 Dec 2013 09:58:05 +0000 (10:58 +0100)]
QtQuick window example improvements: window size and DPI info

On high-resolution displays it's important to size the window so that
the content will fit.  Also show the DPI conversion for pixel density.

Change-Id: Ie35852ecff0bb0ee5ab9b77c6c18e82cfc300448
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
10 years agoDocs: fix Drag::onDragStarted() and onDragFinished() signals
J-P Nurmi [Tue, 17 Dec 2013 22:09:29 +0000 (23:09 +0100)]
Docs: fix Drag::onDragStarted() and onDragFinished() signals

Change-Id: Iefda2d3611ed0f940255f1375ca4c356827fbc70
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoFix & cleanup whitespace in qquickdrag.cpp docs
J-P Nurmi [Tue, 17 Dec 2013 21:53:42 +0000 (22:53 +0100)]
Fix & cleanup whitespace in qquickdrag.cpp docs

Change-Id: I85b986c8b3dca6ccc872807a1d2e8b7b71688c0e
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoFixes: qml memory corruption on Android
aavit [Tue, 17 Dec 2013 15:11:19 +0000 (16:11 +0100)]
Fixes: qml memory corruption on Android

Bionic pthreads reports too small stack size for main thread.

Change-Id: I3d33229e76101a847309c723d534844ffb2d2042
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoensure that qmltest users have CONFIG+=console
Oswald Buddenhagen [Mon, 16 Dec 2013 14:28:53 +0000 (15:28 +0100)]
ensure that qmltest users have CONFIG+=console

Task-number: QTBUG-35603
Change-Id: Ia337845004290d0e01c391130bbf55ec31e52c9e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoDelete a disallowed template instantiation the proper way
Thiago Macieira [Fri, 29 Nov 2013 05:32:55 +0000 (21:32 -0800)]
Delete a disallowed template instantiation the proper way

C++11 allows you to do = delete to the declaration. But some version
of Clang on Mac doesn't like it. I'm guessing it's a compiler bug in
an older version of Clang used in the Qt CI system. I can't reproduce
the issue, so no further investigation was done.

So just remove the "inline" keyword, which is what ICC 14.0 complains
about:

MathExtras.h(270): error #864: extern inline function "clampTo(double, T, T) [with T=long long]" was referenced but not defined

Change-Id: I3887ccb527b5995ffa7ece612f9c7d5a80e71079
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoQtQuick Dialogs: don't use native windows on iOS
Shawn Rutledge [Thu, 12 Dec 2013 11:26:13 +0000 (12:26 +0100)]
QtQuick Dialogs: don't use native windows on iOS

It makes more sense to show the dialogs as items in the scene
rather than as undecorated windows.

Task-number: QTBUG-35561
Change-Id: I2fb29ed8eeb999b99829a9d5ffc088f401d5d602
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoDoc: Made copy of the QML files in the snippets directory
Venu [Tue, 10 Dec 2013 12:44:36 +0000 (13:44 +0100)]
Doc: Made copy of the QML files in the snippets directory

The Delegate.qml and view.qml files were not in the
scope of Qt QML exampledirs. These files were in the example
directory under quick, so had to make of copy of them in the
snippets directory and update the snippet path to get the snippets
in the html output.

Task-number: QTBUG-35445
Change-Id: Ic3fa19dbd36b91d76fbc497ab524f5c0ff91325f
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoFix touch to mouse synthesis/propagation.
Robin Burchell [Wed, 13 Nov 2013 11:41:19 +0000 (12:41 +0100)]
Fix touch to mouse synthesis/propagation.

Having mouse events synthesised from both QtGui and internally in QtQuick  is
not a great way togo about things, especially when QtGui doesn't have the same
degree of knowledge as QtQuick about the items in the scene.

Thus, we now accept all events inside QtQuick to block QtGui synthesis, which
should fix a significant amount of edge-case touch breakage/bad behavior.

Change-Id: I14e1c87761c8f43160049b5e6f9da15b4e5edbb7
Done-with: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoV4 IR: change block scheduling algorithm from recursive to iterative.
Erik Verbruggen [Tue, 3 Dec 2013 14:59:11 +0000 (15:59 +0100)]
V4 IR: change block scheduling algorithm from recursive to iterative.

This makes time- and memory-complexity a lot better when compiling
big JavaScript functions.

Change-Id: I2a7cb9b5979844254747fa5cf7355cca0b113904
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
10 years agoMerge remote-tracking branch 'origin/release' into stable
Frederik Gladhorn [Thu, 12 Dec 2013 17:06:30 +0000 (18:06 +0100)]
Merge remote-tracking branch 'origin/release' into stable

Conflicts:
src/qml/qml/qqmlcompiler.cpp

Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1

10 years agoDon't crash when QCoreApplication is currently being deleted.
Sérgio Martins [Wed, 11 Dec 2013 10:02:17 +0000 (10:02 +0000)]
Don't crash when QCoreApplication is currently being deleted.

In debug mode fixes a crash. The next Q_ASSERT dereferrenced
QCoreApplication::instance().

In release mode fixes hundreds of messages about timers:
"QObject::startTimer: Timers can only be used with threads started
with QThread"

A case where this is reproducible is having a QQuickItem that's child
of qApp, or in some child hierarchy of qApp.

Change-Id: I3b506aefdb537b74dc0d6c755b6874d31be159a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoSafeguard QQuickWindow::hide() against other GL contexts.
Gunnar Sletta [Mon, 18 Nov 2013 07:53:13 +0000 (08:53 +0100)]
Safeguard QQuickWindow::hide() against other GL contexts.

If another GL context is bound to another surface on the GUI
thread, we can run into issues while cleaning up the SG nodes.

Task-number: QTBUG-34898
Change-Id: Ifa02b7cdbc7ab38b3a149a21452cc5071498a7d1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoStabilize Test
Alan Alpert [Mon, 9 Dec 2013 08:06:37 +0000 (00:06 -0800)]
Stabilize Test

A slight variance on this number is acceptable, it should be using
extremelyFuzzyCompare like the rest of the checks on that property.

Task-number: QTBUG-35470
Change-Id: I9114a3a5d3bbc3c63253320637f7af1e5f21a896
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoFix regression in QML string list concatenations
Simon Hausmann [Wed, 11 Dec 2013 14:45:43 +0000 (15:45 +0100)]
Fix regression in QML string list concatenations

String lists and other QList property types (wrapped as QQmlSequence) should
behave like arrays and have the Array prototype. Therefore it should be
possible to pass them also as parameter to concat and they get composed
correctly, i.e. the individual items get appended instead of the list being
appened as one item. In the spec for concat this "special" casing should be
applied if the "class internal property" is "Array", and concat appears to be
the only place where this check is done. Therefore this patch adds another
exception to match the expected behavior in QML and extends the "internal
class is Array" meaning to QML list types.

This is a regression from Qt <= 5.1.x

Task-number: QTBUG-33149

Change-Id: Iab9522ac3c4ae6b746e790a99d87501b1cc1b655
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agotst_qquickflickable: unskip rebound on OS X
Robin Burchell [Sat, 7 Dec 2013 14:13:25 +0000 (15:13 +0100)]
tst_qquickflickable: unskip rebound on OS X

Out of 200 runs on 10.9 + stable branch, I have 0 failures.

Task-number: QTBUG-26696
Change-Id: I84de15b68dfff2cb5f141c5f2a783154db16b77e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoSize changes do not warrant a transform update.
Gunnar Sletta [Tue, 10 Dec 2013 11:25:21 +0000 (12:25 +0100)]
Size changes do not warrant a transform update.

The size is not a part of the matrix, so the matrix does
not need to be recomputed when the size of an element changes.
The exception from this is when using transform origin which
is already specialcased in the QQuickWindow::updateDirtyNode()
function.

Change-Id: I2c517880d39aa69232974f65da93333b7cba341d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoSet highlight size for both dimensions, irrespective of ListView orientation
Robin Burchell [Wed, 4 Dec 2013 21:18:36 +0000 (22:18 +0100)]
Set highlight size for both dimensions, irrespective of ListView orientation

The assumption that all list delegates are the same size (dependent on ListView
orientation) is not a correct one, even if it is correct most of the time.

Task-number: QTBUG-31626
Change-Id: Iba6f3bc5f38d60e3be7632ab17d0c66ab8e73965
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFlickable: Use increased default flick parameters on BB10
Oleg Shparber [Mon, 28 Jan 2013 21:12:59 +0000 (23:12 +0200)]
Flickable: Use increased default flick parameters on BB10

Due to the high resolution the display default flicking speed
is rather slow. This change introduces increased values of
QML_FLICK_DEFAULTMAXVELOCITY and QML_FLICK_DEFAULTDECELERATION
which feel closer to the native experience.

Also cleans up the flick variables a little by moving them to
their own header, so that QQuickPathView can also benefit from
the improved behavior on BB10.

Change-Id: I80878d4cc2a53a8f530b1dc8674f729f70a83119
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoStabilise and remove insignificant marker from tst_qquickflickable.
Robin Burchell [Sat, 7 Dec 2013 13:31:13 +0000 (14:31 +0100)]
Stabilise and remove insignificant marker from tst_qquickflickable.

A lot of work has gone into this test already since
a79839dc5287de1448d1fd858db312a7bfa7b581, such as
6ba7d88df623df5bce85bfdae853fc49006e76f2.

Everything passes for me locally, so let's skip specific tests if they break (or
better: fix them) instead of having no test coverage at all.

Change-Id: I29a7aeb26b106955c442da26df486cb6ce4bc92a
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
10 years agoFix up listening for layout direction changes.
Robin Burchell [Thu, 5 Dec 2013 01:47:34 +0000 (02:47 +0100)]
Fix up listening for layout direction changes.

Change the event type to ApplicationLayoutDirectionChange. LayoutDirectionChange
is sent for QWidgets only at present, and was wrong anyway: each widget may have
a different layoutDirection, but the application instance only has one -- tied
to ApplicationLayoutDirectionChange.

Relies on I2d2ac7dc07f11be5c7e501a3575b1d0978d8ac31 from qtbase to actually function.

Task-number: QTBUG-21573
Change-Id: Ibee25927b2213ae9145d46556698f54d5129bd06
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoUse qCpuHasFeature because the check can be optimized out of existence
Thiago Macieira [Tue, 10 Dec 2013 18:31:04 +0000 (10:31 -0800)]
Use qCpuHasFeature because the check can be optimized out of existence

qCpuHasFeature also checks the compiler flags of this particular build.
If the feature was enabled by the compiler in this .cpp, then no runtime
check is performed and the test becomes an unconditional true.

Change-Id: Ibb7d333e59a0f4ed06b7d0056547177fd69658a0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMark item as dirty when nodes are cleaned
Michael Brasser [Thu, 5 Dec 2013 18:53:09 +0000 (12:53 -0600)]
Mark item as dirty when nodes are cleaned

Otherwise they may not be recreated in the correct configuration.

Change-Id: Ib103b1874d7f104680eae7b6f43f722b5fa93bf2
Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoFix broken Maroon game / regression in PropertyChanges {} element
Simon Hausmann [Tue, 10 Dec 2013 14:25:22 +0000 (15:25 +0100)]
Fix broken Maroon game / regression in PropertyChanges {} element

Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the
expressions in PropertyChanges {} introduced a regression in where the
evaluation context was incorrect and thus bindings would not be able to
access the correct properties. For example

    PropertyChanges {
        target: someObject
        y: height / 2
    }

Here height should be looked up in the context of "someObject", not of the
PropertyChanges element.

This patch introduces an auto-test that verifies that the lookup context is
correct and fixes the bug by disabling accelerated compile time property
lookups for binding expressions that are requested from a custom parser.

Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoQSGRenderer: sanity check attribute regs only when QSG_SANITY_CHECK=1
J-P Nurmi [Tue, 10 Dec 2013 11:11:14 +0000 (12:11 +0100)]
QSGRenderer: sanity check attribute regs only when QSG_SANITY_CHECK=1

The sanity check that attribute registers are disabled that was always
done in debug mode took roughly 16ms on my machine and caused a trivial
QML animation to eat 100% CPU.

Task-number: QTBUG-35443
Change-Id: I8ba2a80db341d17e08216b3cad1678dd59b9b1a5
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoV4: change variable renumbering algorithm from recursive to iterative.
Erik Verbruggen [Thu, 5 Dec 2013 12:14:05 +0000 (13:14 +0100)]
V4: change variable renumbering algorithm from recursive to iterative.

Replace the recursive calls and subsequent clean-ups by pushing actions
on a to-do stack, and processing that stack in a loop.

Change-Id: I83536e88d400592b6e9f5fda3d795e41711a131a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
10 years agoWindows: Use Shell API for checking file case correctness.
Friedemann Kleint [Wed, 4 Dec 2013 14:24:33 +0000 (15:24 +0100)]
Windows: Use Shell API for checking file case correctness.

The old method of converting to short 8.3 name and back does
not work for drives where this is disabled.

Change-Id: Ia0a46331a31eeb61578c31ba063a80665d5fc25c
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoCorrectly profile the size of loaded pixmaps
Ulf Hermann [Fri, 6 Dec 2013 12:57:36 +0000 (13:57 +0100)]
Correctly profile the size of loaded pixmaps

Only set the sizes when they're known, prefer request size to implicit
size (as the request size is what ends up in the cache), and don't set
the size twice.

Task-number: QTBUG-35337
Change-Id: Ie516a1cae2d9050f61362ee99cf8a6a9dd8ea3bb
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoRemove unused function isUnicodeNonCharacter
Thiago Macieira [Sat, 7 Dec 2013 04:58:14 +0000 (20:58 -0800)]
Remove unused function isUnicodeNonCharacter

Found by ICC 14.0:
qhashedstring.cpp(199): warning #177: function "isUnicodeNonCharacter" was declared but never referenced

Change-Id: I62b113e41197dac12f73db8347e22c825e404627
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix crash in QQuickLoader when source component is garbage collected
Simon Hausmann [Thu, 5 Dec 2013 15:21:03 +0000 (16:21 +0100)]
Fix crash in QQuickLoader when source component is garbage collected

It may happen that the QQuickLoader is the last entity left in the system
holding a reference to the QQmlComponent *sourceComponent. We have to let the
garbage collector know about that by keeping a persistent value for it.

Task-number: QTBUG-35334
Change-Id: I715864440378fd9dd4f2d5ef8ff2f171c81ed7ef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoProfile a pixmap start event also when loading is asynchronous.
Ulf Hermann [Tue, 3 Dec 2013 13:45:12 +0000 (14:45 +0100)]
Profile a pixmap start event also when loading is asynchronous.

If those events aren't profiled we get unmatched events for finished
loading and errors.

Task-number: QTBUG-35337

Change-Id: I132638edf5625566e37ee06453484f80b2adb74a
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoFix: QSGGeometry lineWidth in qsgbatchrenderer
Torgeir Lilleskog [Thu, 5 Dec 2013 11:34:40 +0000 (12:34 +0100)]
Fix: QSGGeometry lineWidth in qsgbatchrenderer

lineWidth was ignored in the new scenegraph batchrenderer.
Regression from 5.1.1

Task-number: QTBUG-35346
Change-Id: I80eacc165f70b5f39d4a01cf458ab1a0e49cbd2d
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoPropegate filtering state when we extract texture from atlas.
Gunnar Sletta [Thu, 5 Dec 2013 08:15:06 +0000 (09:15 +0100)]
Propegate filtering state when we extract texture from atlas.

Task-number: QTBUG-35395

Change-Id: I5ac08ade7763d14bca855b8300156aee0e6a6920
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoAvoid warnings on cast from char* to QString
Thiago Macieira [Thu, 14 Nov 2013 23:38:12 +0000 (15:38 -0800)]
Avoid warnings on cast from char* to QString

Why isn't QtQml being built with those functions disabled, so they
produce errors?

Change-Id: I2c0cf945523142800982f100a61a6c10e1929632
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
10 years agoOnly emit focusObjectChanged when an actual change occurs.
Michael Brasser [Thu, 5 Dec 2013 17:35:44 +0000 (11:35 -0600)]
Only emit focusObjectChanged when an actual change occurs.

Change-Id: If18b460a8773e5cac597c02c51836b79711c20f4
Done-with: Matthew Vogt <matthew.vogt@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoClean up property dependency data structures
Simon Hausmann [Thu, 5 Dec 2013 13:53:58 +0000 (14:53 +0100)]
Clean up property dependency data structures

As a follow-up to the previous commit, this patch cleans up the data structures
used to track dependencies of QML binding expressions and functions to context
and scope properties, determined at compile time.

Instead of "collecting" these depending properties upfront (codegen time), we
propagate the information that a property is a context or scope property into
the IR at codegen time and later in the isel collect these properties and their
notify signal index in a hash in the IR functions. The CompileData structure
generator then can read these hashes directly when writing out the dependency
information.

Change-Id: I32134706e2d24bf63d1b1abad0259ab072460173
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix dependency calculation for context and scope properties
Simon Hausmann [Wed, 4 Dec 2013 15:30:54 +0000 (16:30 +0100)]
Fix dependency calculation for context and scope properties

We were incorrectly calculating writing to a context or scope property as a
dependency for an expression. We don't know whether a property is being written
only or also being read from at lookup time, but we can make that decision in
the isel then when generating the move instructions.

So initially context and scope properties end up in a candidate set first
and get promoted to real dependencies when they're being used in reading
moves.

Task-number: QTBUG-35210
Change-Id: Ia67057abafc2d611e1e6605327b4965ebe91cbed
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoSet the format for the fallback offscreen surface
Laszlo Agocs [Thu, 5 Dec 2013 13:53:27 +0000 (14:53 +0100)]
Set the format for the fallback offscreen surface

Ie76dbe5fd4ab935db3da34f3ff63d217a3ba5013 fails to set the format
for the QOffscreenSurface, resulting in BAD_MATCH failures when trying
to make it current.

Task-number: QTBUG-35410
Change-Id: I1d420556fad4df96a1893cb3513e398eeb6e71aa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix broken visibility property assignment after d0644b040e
Tor Arne Vestbø [Thu, 5 Dec 2013 14:22:56 +0000 (15:22 +0100)]
Fix broken visibility property assignment after d0644b040e

Task-number: QTBUG-35412
Change-Id: I09feca09030a2eb07aa1abebf65481d68b880c79
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix data layout of Managed class
Lars Knoll [Fri, 29 Nov 2013 14:24:16 +0000 (15:24 +0100)]
Fix data layout of Managed class

The internal class should really be the first member. The
flags should go away over time.

Change-Id: Id2373a438e2af63a55704819c9dd5569c3895080
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix dynamic properties in QQmlPropertyMap not always being visible in QML
Simon Hausmann [Wed, 4 Dec 2013 13:24:24 +0000 (14:24 +0100)]
Fix dynamic properties in QQmlPropertyMap not always being visible in QML

QQmlPropertyMap is a fully dynamic class that can add properties at any point
in time. In order for these properties to be visible inside QML, we must
disable the property cache (instead of trying to unsuccessfully re-fresh it).

What happened in this particular case is that the QQmlPropertyMap derived type
was instantiated and the VME instruction for creating it would also assign the
property cache the compiler determined. There's no way for QQmlPropertyMap
itself to access this property cache instance (stored in
output->types[id].typePropertyCache) or invalidate it, so instead don't use the
compiler's property cache when instantiating the type.

This patch also disallows the adding properties to QQmlPropertyMap when it
is used as base type for a new QML type, as we cannot provide the derived
type to the QQmlPropertyMap constructor - this is only possible in C++.

Task-number: QTBUG-35233
Change-Id: I7fa9e4a2224ccfdd7ccb3fd9f73919ecd46058a8
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix Flickable StopAtBounds drag over, back, over behavior.
Martin Jones [Wed, 27 Nov 2013 06:13:29 +0000 (16:13 +1000)]
Fix Flickable StopAtBounds drag over, back, over behavior.

A Flickable with StopAtBounds failed when:
1. position on a boundary.
Without lifting your finger:
2. attempt to drag beyond the boundary -> doesn't drag
3. drag back to initiate dragging
4. attempt to quickly drag beyond the boundary.

After 4, the view should be back on the boundary, but it could get
stuck a little short of the boundary.

Change-Id: I9bfbb4293f4d464bddb97c5c37e9bb91ed7d48e4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
10 years agoFix a crash in JSON.parse
Lars Knoll [Wed, 4 Dec 2013 15:03:59 +0000 (16:03 +0100)]
Fix a crash in JSON.parse

Properly set members that are actually array indices
and don't crash when trying to set those.

Task-number: QTBUG-35383
Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
10 years agoV4 IR: reverse propagate int32 truncation.
Erik Verbruggen [Fri, 18 Oct 2013 15:02:57 +0000 (17:02 +0200)]
V4 IR: reverse propagate int32 truncation.

Change-Id: I5cb0c7798d0e530f3137710bf0e723bd7b64dc89
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoQQmlImport: Don't try use a dangling pointer.
Robin Burchell [Tue, 3 Dec 2013 20:47:02 +0000 (21:47 +0100)]
QQmlImport: Don't try use a dangling pointer.

toUtf8 would return a temporary, and constData would hold a pointer inside that
temporary. This isn't even remotely safe. Move the pointer use down to the
initializeEngine call so it is kept around long enough for us to do our stuff.

This is a backport of cf51cdb8fb002ae3602a4c886e7c67913d77373a.

Task-number: QTBUG-35355
Task-number: QTBUG-35343
Change-Id: I338ad7f4d4137445ed9a311a293ea82bf023aafd
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agostatic builds: add classname entry to qmldir for QtQuick.Dialogs.Private
Richard Moe Gustavsen [Wed, 4 Dec 2013 10:25:13 +0000 (11:25 +0100)]
static builds: add classname entry to qmldir for QtQuick.Dialogs.Private

Add classname entry to qmldir, otherwise qmlimportscanner cannot
utilize it when doing static builds (on iOS).

Task-number: QTBUG-35369

Change-Id: If5440ffcdd805a832d4ff1d129e9f24d222b45d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoQQmlMemoryProfiler: Fix dangling pointer use.
Robin Burchell [Tue, 3 Dec 2013 21:16:27 +0000 (22:16 +0100)]
QQmlMemoryProfiler: Fix dangling pointer use.

toUtf8 returns a temporary, accessing constData isn't safe

Change-Id: I3c4d077f24cee0eaf1df230c4d8079619967b51a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRevert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"
Alan Alpert [Tue, 3 Dec 2013 16:41:04 +0000 (08:41 -0800)]
Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"

This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7.

While the additional flexibility would be nice, I've been reminded that
we already did commit to it back in July.

Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoFix binding loop in Maroon in Trouble QML demo
Topi Reinio [Tue, 3 Dec 2013 16:25:41 +0000 (17:25 +0100)]
Fix binding loop in Maroon in Trouble QML demo

Task-number: QTBUG-35210
Change-Id: I44bd9f19acba5b59711aa4ca3d2b12c246afcc59
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Sebastian Wozny <swozny@blackberry.com>
10 years agoDon't leave the GL context current after cleanup.
Gunnar Sletta [Wed, 4 Dec 2013 09:20:22 +0000 (10:20 +0100)]
Don't leave the GL context current after cleanup.

When shutting down, we left the gl context current on the window even
when it was hidden. On mac this was a problem as it would optimize
away our makeCurrent when the surface was made visible again, leading
to nothing being rendered. So we call doneCurrent regardless during
invalidateGL(). We also check and verify that makeCurrent in
invalidateGL() actually succeeds.

This lead to another problem which is that closing the app using [x]
will call QWindow::destroy() on all windows, removing their platform
windows and causing makeCurrent to fail. To still gracefully clean up
resources, we introduced the concept of an offscreen fallback surface
which is temporarirly used during the cleanup when needed.

The problem is still present on QWindow+QOpenGLContext level, and
I've opened QTBUG-35363 to fix this.

Task-number: QTBUG-35234
Change-Id: Ie76dbe5fd4ab935db3da34f3ff63d217a3ba5013
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoRemove unused member
Lars Knoll [Fri, 29 Nov 2013 07:42:07 +0000 (08:42 +0100)]
Remove unused member

Change-Id: I9926f1ab10ea04387f17794944dcc11f4a2a9054
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix some header guards
Lars Knoll [Fri, 29 Nov 2013 07:40:53 +0000 (08:40 +0100)]
Fix some header guards

Change-Id: Ib696c79754cc238e3f4fa356c461a07d9f06d6e7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoEncapsulate the current context and fix it's usage
Lars Knoll [Thu, 21 Nov 2013 15:41:32 +0000 (16:41 +0100)]
Encapsulate the current context and fix it's usage

Encapsulate accesses to the current context, and rework
the way we push and pop this context from the context
stack.

Largely a cleanup, but simplifies the code in the long term

Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove setVTable calls in performance critical areas
Lars Knoll [Thu, 21 Nov 2013 13:26:08 +0000 (14:26 +0100)]
Remove setVTable calls in performance critical areas

Remove all the calls to setVTable that were in performance
critical parts of the code. This now brings performance
back to the level we had with the vtable inlined in the
Managed objects.

Change-Id: I76317cc5c53b5b700d1d3883b954407142a4c424
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove the vtable pointer from the object to the internal class
Lars Knoll [Thu, 21 Nov 2013 12:15:46 +0000 (13:15 +0100)]
Move the vtable pointer from the object to the internal class

This saves one pointer per object, and willmake other optimizations
easier in the future.

Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix a bug in the code for eval
Lars Knoll [Fri, 22 Nov 2013 07:32:37 +0000 (08:32 +0100)]
Fix a bug in the code for eval

When eval was being used as an indirect call, the code
didn't reset the current context properly before
returning from the eval call.

Change-Id: Id5c7e9a897101d25593ef0f3b9945adaf19360b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAdd a static toArrayIndex() method to QV4::String
Lars Knoll [Thu, 21 Nov 2013 13:25:49 +0000 (14:25 +0100)]
Add a static toArrayIndex() method to QV4::String

This avoids a hack in QV4::Codegen where we created a V4::String
on the stack to convert to an array index.

Change-Id: I9a88d45817bbcde52a4037a52fbae299b8c9cb1a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFixup the implementation mess for QJSValue(QString)
Lars Knoll [Tue, 26 Nov 2013 09:46:44 +0000 (10:46 +0100)]
Fixup the implementation mess for QJSValue(QString)

Until now we were using a QV4::String without engine to
represent this case. But this leads to lots of quirks, where
we ended up trying to access the engine (or the internalclass/vtable)
of this string anyway.

Now just represent it by using an QString in QJSValuePrivate, and use
an empty value to represent it. This adds a little bit of code to
QJSValue and QJSEngine, but is more stable and maintainable in the
longer term.

Change-Id: I3358165ee64e788274225743a95dfb13346225cc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize ExecutionContext::setProperty
Lars Knoll [Fri, 15 Nov 2013 21:40:07 +0000 (22:40 +0100)]
Optimize ExecutionContext::setProperty

No need to call hasProperty followed by put. Instead get the
property descriptor and call putValue for it.

Improves v8-bench by 5%.

Change-Id: Ied047126c651c033f7ad4c27deaeec08e5fee7f9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse an internalClass to represent formals and locals in CallContexts
Lars Knoll [Fri, 15 Nov 2013 15:36:13 +0000 (16:36 +0100)]
Use an internalClass to represent formals and locals in CallContexts

formals and locals in a CallContext where so far accessed through a
linear search in ExecutionContext::getProperty. Fix this by
introducing an internalClass for the Function used by the call
context.

Change-Id: I1141efa12b19d6de4a354bfd6e769c5ffcb8898b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove unused inline wrapper
Lars Knoll [Fri, 15 Nov 2013 13:22:35 +0000 (14:22 +0100)]
Remove unused inline wrapper

The wrapper method for Function::code() was still there
from the times we used C++ exceptions. It's not needed
any more, so get rid of it.

Change-Id: I2ec25fbca71eeef9d7a94a38b5adfa42e4de3a84
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix url type test
Lars Knoll [Fri, 15 Nov 2013 12:44:47 +0000 (13:44 +0100)]
Fix url type test

it passed before, but wasn't testing two methods it
should be testing.

Change-Id: I5784ecfe1b5a00620832c7b995ed3cf5ed7e27dd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSpeedup JS instanceof operator
Lars Knoll [Thu, 14 Nov 2013 21:08:00 +0000 (22:08 +0100)]
Speedup JS instanceof operator

Cache the prototype of the functionobject, and inline hasInstance.
This removes a vtbl method and speeds things up quite a bit.

Change-Id: Ic68f301f7e09763d445a98bffa2cd201303f902e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoInitialize variable
Lars Knoll [Fri, 29 Nov 2013 13:26:52 +0000 (14:26 +0100)]
Initialize variable

Change-Id: I37b14a406ebb9cf87fef20426a94725a2441b7cd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix qsTr() in .js context
J-P Nurmi [Mon, 2 Dec 2013 16:25:23 +0000 (17:25 +0100)]
Fix qsTr() in .js context

Don't assume a four characters long file name suffix (.qml)

Task-number: QTBUG-32850
Change-Id: I522c06b71bf1b38f32f2947a6c06017f83eb50be
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoQQmlImport: Don't try use a dangling pointer.
Robin Burchell [Tue, 3 Dec 2013 20:47:02 +0000 (21:47 +0100)]
QQmlImport: Don't try use a dangling pointer.

toUtf8 would return a temporary, and constData would hold a pointer inside that
temporary. This isn't even remotely safe. Move the pointer use down to the
initializeEngine call so it is kept around long enough for us to do our stuff.

Task-number: QTBUG-35355
Task-number: QTBUG-35343
Change-Id: Ie816d0d1a37e42607f26d9ad02cf999f3d459cd9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMerge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging...
Frederik Gladhorn [Tue, 3 Dec 2013 17:26:49 +0000 (18:26 +0100)]
Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable

10 years agoMerge remote-tracking branch 'origin/release' into stable
Frederik Gladhorn [Tue, 3 Dec 2013 17:15:53 +0000 (18:15 +0100)]
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I894ad7b4888744833f487b481950c087fa960a5c

10 years agoImprove the Canvas threading model
Gunnar Sletta [Wed, 27 Nov 2013 16:04:06 +0000 (17:04 +0100)]
Improve the Canvas threading model

The canvas classes were mixing scene graph resources and GL
content across threads. This led to a number of potential crashes
in addition to that the FBO based rendering had significant
potential for stalling.

QQuickContext2DTexture is no longer a QSGTexture with ambiguous
ownership. Instead we use textureForNextFrame which is called
on the render thread while the GUI is locked to synchronize
state from the Context2D's "texture" into the actual QSGTexture.
This means that cleanup of the QQuickContext2DTexture and
the QSGTexture used for display is no longer in conflict.

QQuickPixmap no longer contains a QSGTexture either as these
are strictly for use on the scene graph thread. The Images are
anyway loaded explicitly as QImage files in QQuickContext2DContext
and uploaded again for every Canvas, so relying on the GL paint
engine to do the caching will give us the same with less code.

I also changed the default strategy to Immediate as that one
supports the full API (cooperative does not support readback)
and because cooperative is pretty bad for performance since the
rendering happens in the sync() step.

Task-number: QTBUG-34268
Task-number: QTBUG-31052
Task-number: QTBUG-21935
Task-number: QTBUG-30689
Task-number: QTBUG-29007

Change-Id: Ic540b22d5faa1188e21e56a3beee24191d13f423
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoRevert "Load "@2x" images on high-dpi "retina" systems."
Morten Johan Sørvig [Tue, 3 Dec 2013 13:34:05 +0000 (14:34 +0100)]
Revert "Load "@2x" images on high-dpi "retina" systems."

This reverts commit 707bbe5dea9d7398b205124a54422f2fafb6f151.

By itself this is completely broken and the image will
display at twice the size. We need to add code to handle
the @2x image but revert for now to get sane behavior.

Change-Id: Iccdb26e9d19930b5d0ef4b6c7f596c5766f77a8a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
10 years agoUpdate changelog for change Icf323618 / QTBUG-35174
Tor Arne Vestbø [Fri, 29 Nov 2013 11:11:48 +0000 (12:11 +0100)]
Update changelog for change Icf323618 / QTBUG-35174

Change-Id: Idff1507fdce960ad7dabc2662bb273bc6103c1ca
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoRelease GL resources of ShaderEffectSource while we still have GL.
Gunnar Sletta [Tue, 3 Dec 2013 13:55:40 +0000 (14:55 +0100)]
Release GL resources of ShaderEffectSource while we still have GL.

When a Window element is used, the QML window item is deleted before
the ShaderEffectSource component and the deleteLater to delete the
texture gets handled too late. We now register for the
sceneGraphInvalidated signal and release resources synchronously
while shutting down.

Task-number: QTBUG-35294
Change-Id: Id83b669ddc16723551e5612264ccbad6d3a9bbcb
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoDrop the "missing provider" warning from ShaderEffect.
Gunnar Sletta [Mon, 2 Dec 2013 08:13:04 +0000 (09:13 +0100)]
Drop the "missing provider" warning from ShaderEffect.

Task-number: QTBUG-34676
Change-Id: I5f1c2f9ebe6048da5d5c1d1ea5e4799eacea3e8b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix typo in debug define
Gunnar Sletta [Tue, 3 Dec 2013 09:24:29 +0000 (10:24 +0100)]
Fix typo in debug define

Change-Id: I4d024aeb4618228cad3000ddfda32e5c8aba5742
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoFix style animations to stop when the item is hidden
J-P Nurmi [Mon, 2 Dec 2013 21:44:21 +0000 (22:44 +0100)]
Fix style animations to stop when the item is hidden

QStyleAnimation automatically stopped for hidden QWidgets, but didn't
know anything about QQuickItems and kept animating regardless of their
visibility. QStyleAnimation was changed so that it will keep animating
only as long as the animation target accepts animation updates. This
change ensures that the style animation updates are accepted only when
the item is visible.

Task-number: QTBUG-35319
Change-Id: I3c93a653316b8abbbc32940cd7499b660828eff8
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
10 years agoFix build in release mode with forced asserts
Konstantin Ritt [Thu, 28 Nov 2013 18:31:04 +0000 (20:31 +0200)]
Fix build in release mode with forced asserts

Change-Id: I0e35533af7f65200a8bc3c4024c29344fa6f4b7a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: remove common toInt32 casts.
Erik Verbruggen [Mon, 2 Dec 2013 15:57:32 +0000 (16:57 +0100)]
V4 IR: remove common toInt32 casts.

E.g.:
a | 0
b & 0xffffffff

These operations force the operands to be converted to int32 without
changing their value. At this point we already added convert calls to
the IR, so we can safely get rid of these operations.

Change-Id: Ic4d3b989e13439eccd2c878fa7bf5030acae7630
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: change the worklist to a QSet for block scheduling.
Erik Verbruggen [Mon, 2 Dec 2013 15:35:17 +0000 (16:35 +0100)]
V4 IR: change the worklist to a QSet for block scheduling.

Fixes a crash in octane.

Change-Id: Ib72ac0b7a2941230a87543f30fcf7e55d7094886
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: remove invalid assert.
Erik Verbruggen [Mon, 2 Dec 2013 15:33:58 +0000 (16:33 +0100)]
V4: remove invalid assert.

Both the base and the index of a subscript can (and are allowed to) be
other things than temporaries.

Change-Id: If073e262712bab488f18eac5ebe097be99c40359
Reviewed-by: Lars Knoll <lars.knoll@digia.com>