Fix memory corruption in QML expression compilation

We store QQmlPropertyData pointers in our IR for Qt meta-object property
resolution at compile time. As it turns out however, it is possible that these
pointers change after retrieval from the QQmlPropertyCache, as the cache may
change later in the compilation process. Therefore we must do what also
QQmlCompiler does by storing a copy of the QQmlPropertyData. For the JS IR we
can do that conveniently through the IR memory pool.

A side-effect of this bug was that QQmlPropertyData pointers were re-used
and so the identity check in the isel later such as

    _function->contextObjectDependencies.contains(m->property)

for dependency tracking failed. In the example given in the bug report it was
determined that the window.contentWidth property wouldn't need a property
capture, and therefore the binding was not re-evaluated as window.contentWidth
later in the binding evaluation phase received its correct value.

This patch also fixes the incorrect debug output names assigned to JS binding
expressions, where the index used to look up the name is per compiled object,
not per QML component.

Task-number: QTBUG-35063
Change-Id: I3e5bbfaac11e5c122a2ed15a3e486a93988e1b6e
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
No assert when the focus changes and a window has no active focus item.

[ChangeLog][QtQuick] Fix crash when showing and hiding a window that has
no active focus item.
QtQuickControls hit the situation where a popup window was shown without
ever having an active focus item. When then closing the popup,
clearFocusInScope would assume it had to always modify the old focus,
but in this case the focus would be on the window itself, so there is
nothing to update.

Task-number: QTBUG-35057

Change-Id: Ifbde4689d39f98b13e6f90573cb22e28bb86f2c4
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Fix rendering of Flipable content.

When a batch is merged in the renderer, we use the z component to
stack the item front to back. This works because each item is
guaranteed to have a z-range of 0->1. However, when a projective
matrix is used, we need to compensate for the implicit [x,y,z]/w,
which GL applies to gl_Position after the vertex stage completes,
so that this guarantee still holds.

Task-number: QTBUG-35020
Change-Id: I254a3d4dc9ad22f53717160ec6ad8f3a27b43d1c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Stop render thread regardless when the window is being destroyed

When a window is shown and quickly hidden again we can get to
a state, on a asynchronous windowing system API, where the
isExposed=true event has been pushed to the event queue but
not yet processed at the time the user calls hide().
As hide() immediately sets isVisible() to false, we end up with
isExposed=true and isVisible=false which prevent the WM_Obscure
event to be sent to render loop which means the render thread
thought the window was still on screen when we reched the
shutdown in WM_TryRelease.

Changed WM_TryRelease handling to disregard window state when
the window is being deleted. This forces SG and GL cleanup
and stops the thread.

Task-number: QTBUG-35055
Change-Id: Ibac5aa27354d6450f30a61450214cb785ab855bf
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Use QFontDatabase to check if a font is scalable.

The flag set in QFontEngine was not always correctly set, use
QFontDatabase instead which is slower but should always be correct.
We fallback to native font rendering when the font is not scalable.

Change-Id: Ie9a2397abd42890d0fb05bc2f9c46a60040296f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Fix out of bounds array access when index is integer and negative

When the index is a double, the branchTruncateDoubleToUInt takes care of
branching when the index is negative, but when it's an integer we need
to perform that check ourselves.

Without the patch it's rather easy to cause the application to crash.

Change-Id: If908923ddc2077b3fb3dd42350f038ff0072e8e1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>