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>
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>
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>
Handle scene graph invalidation

Change-Id: Icff592a4ae48444a36406a65c1c04a3a6da77616
Merge pull request #38 from sletta/selected-fixes

[qtdeclarative] Stabilization of the QML Canvas element.