Merge pull request #37 from sletta/selected-fixes

[qtdeclarative] Selected fixes
Don't allow a filtering item to block other filtering items.

With delayed press it's possible for a filtering item to not accept a press
on the first go around but to later steal mouse grab and accept future events.
This means outer items  which also filter will have received the mouse press,
but don't receive release events leading to phantom long presses or inadvertent
drags.

Task-number: QTBUG-37316
Change-Id: I2ff18df2a019f8d3a5e81a0adc2c5b5994799862
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Fix touch/mouse propagation bugs

Filtered mouse release was not delivered if another touch started after a
touchMouseId was activated.  This meant that any filters expecting a
release event would not receive it if another touch was made before release
of the touchMouseId.

We prevented a touch becoming the touchMouseId in the child mouse filters
if there were any existing touches. The normal event delivery, however,
does not require a single touch.

Further to the previous, a touch could become the touchMouseId, even if
the initial press happened when there was an existing touchMouseId. This
meant that a touch could turn into a mouse when the existing mouse event
was released, resulting in a new touchMouseId which hadn't been through
child mouse filters.

Flickable delayed press should be sent via normal event processing, as other
touch/mouse events are now delivered in this way.

We often called childMouseEventFilter() multiple times for each event. This
is bad because the gesture handling relies on claiming a gesture in one event,
then stealing it in the next.

Instead of sending touch to mouse candidate points already determined to be
within the item bounds and already transformed, we sent all of the points
to the mouse recipient.

PinchArea did not store the starting position at the original touch points,
so other items could pass the dragThreshold before PinchArea and steal a gesture
meant for PinchArea.

Task-number: QTBUG-40330
Change-Id: Ic0009c176d3d1cb7cff0b5eda076a2c3ca864136
Use the current context to resolve extensions.

When updating the code to not use direct gl calls, this
code was changed to use the context's gl context. The
context doesn't have a context when the rendering happens
on the same thread as the scene graph rendering and
we get a crash.

Change-Id: I8adf62c0ed12bb055982a71ba59af76afeefcca1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Support Canvas.antialiasing without multisample support.

FBO based rendering relies on framebuffer multisampling to do
antialiasing, which is often not available on OpenGL ES and even on
some desktop chips. As a high-level API, it is quite bad that Canvas
users (on embedded in particular) have to choose between quality
(Image) or performance (FBO).

This change implements super sampling, rendering the content
at twice the size and then scaling it down.

[ChangeLog][QtQuick][Canvas] Implement antialiasing on
FramebufferObject based render targets through super-sampling (SSAA)
when framebuffer multisampling is not available.

Change-Id: I373f3a645342dac157506b746c1e39b0f3f3f9f2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
More QQuickCanvas cleanup handling.

Avoid calling into QQuickContext2D from QQuickContext2DTexture
after QQuickContext2D has been deleted. We acheive this by

1. Giving the texture a direct pointer to the gl context and
   and surface, so that it doesn't need to go through m_context
   to get to them (which may have been deleted).

2. Protect access to QQuickContext2DTexture::m_context with
   a mutex and make sure it is set to 0 in a safe manner
   when the QQuickContext2D object is deleted.

Change-Id: Ie0a30f9fc46f844224838a7cdf2f28a62e8ce322
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>