Compositor: provide a way to update the clipboard on a client

Clipboard synchronization happens when a client is keyboard-focused, but
some clients may require clipboard access even when not in focus. Add
an updateSelection() slot to QWaylandSurface so that the compositor
implementor can synchronize the clipboard manually or through a
signal-slot connection.
Merge pull request #33 from xknight/master

Compositor: provide a way to update the clipboard on a client
Compositor: Extend QWaylandSurfaceNode from QSGSimpleTextureNode

Use the convenience base class to remove replicated code and make use
of QSGTextureMaterial's internal optimizations.
Merge pull request #34 from xknight/master

Compositor: Extend QWaylandSurfaceNode from QSGSimpleTextureNode
wayland-egl: Add support for extra swaps upon window resizes

If an EGL implementation does not take care of surface resizing through
wayland (native) window resize mechanisms, it is allowed by spec to detect
the resize on eglSwapBuffers(). However, this means that in the junction
of resize there is a possible conflict in rendered size and window size and
the rendering (if this happens to be the last frame rendered for a while)
might be left incomplete or clipped.

Furthermore, some implementations seem to resize the surface *after* the swap
that follows the native window resize, not *during* the swap.

The simplest and possibly most flicker-free solution is to issue an extra
swap when the native window has been resized but new content is not rendered
yet. This requires the SWAP_BEHAVIOR to preserve the buffer contents but
it would allow the implementation to detect the double swap and optimize it
(maybe even completely away).

This patch implements that strategy by querying the window if it needs an
extra swap when the related surface is made current, ie. rendering to it
is starting. Since this problem isn't a concern for many platforms, the
flag is hidden behind a compile-time option so one needs to opt-in for it.

Signed-off-by: Kalle Vahlman <kalle.vahlman@movial.com>