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>
Update changelog for change Icf323618 / QTBUG-35174

Change-Id: Idff1507fdce960ad7dabc2662bb273bc6103c1ca
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
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>
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>
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>
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>
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>
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>
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>
Fix broken visibility property assignment after d0644b040e

Task-number: QTBUG-35412
Change-Id: I09feca09030a2eb07aa1abebf65481d68b880c79
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>