Fix build break in linux

Fixes build break when built on linux with wayland libs installed
via pkg manager.

Change-Id: I17be64e702d07e817a2e34e76ddbe8dde064f3d2
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Improve the frame callbacks handling

Improve the way wl_surface's frame callbacks are handled. The sooner
they are sent the better is for the clients, as they have more time to
render the next frame, but reducing the time for the compositor to
render its frame. The best compromise is probably to send them out
after the compositor has issued its GL calls but before calling
eglSwapBuffers(), and before the GPU actually draws anything.
Rename the function to send the callbacks to only reflect its purpose,
leaving the compositors free to choose when they want to send them.

Change-Id: Ifcdfcad9e54b4d07d5c087898123ac724395a194
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Make the compositor test build

Change-Id: Ic4137ff7f69b293db60fa1232602cd4560497d6e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Fix build with Wayland <= 1.1

Change-Id: Idd12c0db73203daa008d93c0dc8053e25dff09e2
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Strip custom prefix from interface name

Interface names for some protocols might not start with wl_ or qt_,
with this change users can specify a prefix of their liking.

Change-Id: I70d40985165c49114b525bdec2a872aa5b0dad6d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Merge remote-tracking branch 'origin/dev' into stable

Conflicts:
	src/compositor/wayland_wrapper/qwlsurface.cpp

Change-Id: I3b6a4af41f272d3dc7fc920ba2542f2dd7978175
Change the minimum required Wayland version back to 1.2

As discussed, Wayland 1.3 is not common in distributions yet, and
that is a problem for the C.I. machines.

Change-Id: Iec5c6d8ae1d1a50199f66d45ca9269694db78efe
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Create the egl windows and context with the right config

The egl config should be calculated when creating the window, and
the format of it should be set accordingly. The format of the window
and the one of the context will then match if using the same format
as input.

Change-Id: Ie93735171d8945111a450263089e192919249b68
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Support changing the keymap

This adds new API, but does not add a way for the user to set the
keymap. That should be implemented in the compositors.

Change-Id: I28ee7d372f8f578c0d7efb9223cabce49504be1f
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Updated required version

Change-Id: I0284bcac551c13d3f8a7e71c00f0f68cd7872f08
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fix build break

Remove the removed argument from the EGL platform context constructor.

Change-Id: I6203d07c356f7191a698d8d5bc958923cbdc2d96
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Remove the buffer queue.

A client calling attach(A);commit();attach(B);commit() should result
in its back buffer be set to B, and A be discarded.
If the client wants to have a queue it should keep it client side or
a protocol extension tailored for that purpose should be developed.

Change-Id: Ia0048f311504d85821df9f5b9225887801efec71
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Make sure the frame callbacks are sent at the right time

When there is a rendering thread, like with QtQuick compositors,
there is a race condition where the frame callbacks are sent before
the last buffer the client sent is released.
Assume the following scenario:
attach(B1)/frame(F1)/commit()...frame started...attach(B2)/frame(F2)/
commit()...frame finished.
On frame finished the callback just installed is emitted before the
buffer B2 is being used and B1 released. That forces the client to
allocate a third buffer to draw the next frame.
Now, do not send out the frame callbacks until a new frame started.
The successive draw will release B1, use the new B2 and than send out F2.

Change-Id: I5743c7baf9fdd3cde28c5f594ff646c06abb74b7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Compile ServerBuffer client example on desktop gl

Change-Id: I8efbda3e5266c5668b2461429a21d900e2ecd175
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Fixup for GLX integration

Change-Id: I2de94481f7d3e109fdce7ca961f8969299cf5d9e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Take advantage of the Qt 5 plugin json structure

Also change naming scheme of plugins:
buffer integrations doesn't start with "wayland-" but the platform
plugins have to start with "wayland-".

Also update the README

Change-Id: I6dd2103ab287ed569ab06cfb6eb469e3db058831
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Flush the clients connection after sending the frame callbacks

We want to make sure the events reach the clients asap.

Change-Id: I0783c6be4f4412fd5f3665faec1e57d141291ce7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Make the compositor redraw when a surface gets a commit().

It must redraw, even if it doesn't actually redraw anything, irrespective
of the fact that a attach/damage has come or not. Just calling frame();commit()
is perfectly valid.

Change-Id: If298654b8a7cb7c954cfbad8618f23134731cb9f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Fix NPOT decoration texture binding

If the context does not support the NPOTTextureRepeat (i.e. GL_OES_texture_npot extension), wrapping must be set to CLAMP_TO_EDGE to prevent invalid texture mapping.

Change-Id: I3ededccc14a32188986529c14fa91161fb383cfc
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Remove the QWidget compositor example

The QWidget API isn't well fit for a Wayland compositor, and does
not have any advantage over a QWindow, which can also draw using
QPainter. Besides the current implementation doesn't work properly,
and no one seems to be interested in fixing it.

Change-Id: Id1c337506af48e1d1fdd8d14f0ed637d299702f3