waffle: Add feature test macro WAFFLE_API_VERSION

This macro controls the API exposed by Waffle's headers. Use it to guard
the new API added in waffle 1.3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
man: Document WAFFLE_API_VERSION

Add new page, waffle_feature_test_macros(7) that mimics the standard
page feature_test_macros(7). Document that WAFFLE_CONTEXT_DEBUG and
WAFFLE_CONTEXT_FORWARD_COMPATIBLE require WAFFLE_API_VERSION>=0x0103.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Compile with stricter error checking

Add -Werror=incompatible-pointer-types and -Werror=int-conversion to the
compiler flags.

I'm surprised that gcc doesn't enable them by default.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
core: Define wcore_error_errno()

This emits WAFFLE_ERROR_UNKNOWN and a message that includes the
stringified errno.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wayland: Make all public entry points synchronous

Waffle's public entry points are syncrhonous for GLX and X/EGL (or at
least I tried to make them so), but not for Wayland. The difference in
behavior led to a bug in examples/gl_basic and Piglit.

Wayland has flushing requirements that differ from X, largely due to
Wayland being agressively asyncrhonous. For example, according to
wl_display(3), in event loops "the client should always call
wl_display_dispatch_pending() and then wl_display_flush() prior to going
back to sleep".  Otherwise, all pending requests may not be dispatched
to the server.

Waffle can't expect the client to be aware of Wayland's flushing
requirements and to make the needed native Wayland calls before
blocking. Instead, the only sensible solution (for now, at least) is to
make the public entry points synchronous.

I'd prefer that Waffle calls be asynchronous when possible, but there
exists nothing yet in Waffle's API to handle asynchronous events.

This fixes examples/gl_basic and Piglit under Wayland. In the draw loop,
the last call to waffle_window_swap_buffers() failed to update the
window contents due to the flushing requirement discussed above.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
x11: Define x11_window_resize()

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Implement waffle_window_resize()

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
xegl: Implement waffle_window_resize()

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wayland: Implement waffle_window_resize()

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cgl: Implement waffle_window_resize()

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
examples/gl_basic: Add option to resize window between colors

Add option --resize-window, which enlargens the window between each draw
call.

Validated on:
    - CGL, Mac OS 10.7
    - Wayland under Weston

Resizing causes the glReadPixels check to fail on GLX and X/EGL under
Gnome Shell. This nicely exposes someone's bug, but whose?

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'window-resize'