compositor: Refactor weston_output_mode_switch()

This breaks weston_output_mode_switch() into 3 functions:
weston_output_mode_set_native()
weston_output_mode_switch_to_temporary()
weston_output_mode_switch_to_native()

Differences from previous behaviour:
SET_NATIVE didn't set current_scale (now it does)
SET_TEMPORARY could set mode and scale independently - now it can't.
cosmetic: replace boolean function return values with bool

For functions that test if something is true/valid and return a 1
or 0, it makes sense to switch to bool.
backends: refactor transform string parsing

Most of the backends do their own parsing of transform strings, so let's
put that all in the same place (compositor.c/h)
rpi-renderer: don't pass a box to pixman_region32_contains_point()

We don't care which box contained the point, so don't pass one in.
gl-renderer: compress pixman bands to simplify geometry

Pixman uses y-x banded rectangles to represent regions.  We use these
y-x banded rectangles to generate triangle fans, resulting in more
geometry than strictly necessary to draw the screen.

This patch combines the bands to reduce geometry for complex scenes.
weston_surface: Add surface-to-buffer and buffer-to-surface matrices
gl-renderer: Call glViewport after the context is made current
Use pixel coordinates for weston_output.matrix

Previously, weston_output.matrix was in GL coordinates and therefore only
really useful for the GL backend.
zoom: Use pixels instead of GL coordinates

Previously, the zoom functions used GL coordinates natively which doesn't
work with the new output matrix calculations.  This changes zoom to work in
pixel coordinates to match the new output matrix format.  This also cleans
up the math in the zoom code substantially.
pixman-renderer: Add a weston_matrix_to_pixman_transform function and
simplify the buffer-to-output matrix computation

Now that we have a buffer-to-surface matrix and the global-to-output matrix
is in pixels, we can remove a large chunk of confusing code from the pixman
renderer.  Hopefully, having this stuff in weston core will keep the pixman
renderer from gettin broken quite as often.
pixman-renderer: Use output->matrix for region transformations and enable output zoom
compositor: Move weston_matrix_transform_region to compositor.c and export it

We're going to use this to replace much of the other transform code so
it's no longer just relevant to pixman-renderer.c
compositor: add weston_matrix_transform_rect() and use it where appropriate

New function that transforms a pixman_box32_t rectangle by a matrix.

Since pixman rectangles are represented by 2 corners, non-90 degree
rotations can't be properly represented.  This function gives the
axis aligned rectangle that encloses the rotated rectangle.

We use this for matrix_transform_region() and weston_matrix_transform_rect(),
simplifying them and allowing them to work for non 90 degree rotations.
compositor: use matrix transforms for surface_to_buffer functions

Now that we have weston_matrix_transform and appropriate matrices we can
use that instead of weston_transformed_coord + scaler_surface_to_buffer.

scaler_surface_to_buffer no longer has users, so remove it.
compositor: use weston_matrix_transform_region for overlay setup
compositor: Remove weston_transformed_region

Replace all uses of weston_transform_region with
weston_matrix_transform_region, then remove the function completely.
compositor: Add a function to test if images transformed by a matrix should be bilinearly filtered

If a transformation matrix causes a scale, a rotation not a multiple of 90
degrees or a non-integer translation then textures rendered with
it would benefit from bilinear filtering.

This test is done in a lazy fashion by examining elements of the matrix
to check for a simple pattern that indicates these conditions are met.
renderers: use weston_matrix_needs_filtering to choose filter parameters in gl and pixman renderers

Note: This causes a performance drop when zoomed under pixman.  Also, pixman
has clever optimization algorithms to switch from BILINEAR to NEAREST
automatically when it detects they'll have the same result - we still do our
own test here because the pixman check misses a few opportunities when the
display is flipped.
compositor-drm: use weston_surface_to_buffer_rect instead of weston_transformed_rect

The weston_transformed_rect() call should have the same result as
weston_surface_to_buffer_rect().

Also, this mix of fixed, float, and int is difficult to follow and I don't
trust it, so just convert to fixed for the plane API at the end of the
calculation.
compositor: Remove weston_transformed_rect() and weston_transformed_coord()

The last caller of weston_transformed_rect() has been replaced so we can
remove weston_transformed_rect() - since it was the last caller of
weston_transformed_coord() we can get rid of that too.