emugl: Add *experimental* support for 'osmesa' backend.

This patch adds support for the 'osmesa' EmuGL backend, which can
be used to perform software-based rendering. This does not work
yet, for reasons probably related to the current state of OSMesa
though (more on this later).

To use it, you must be on Linux (for now) and do the following:

  export ANDROID_EMULATOR_EXPERIMENT_READ_PIXELS=1
  export ANDROID_EGL_ENGINE=osmesa
  objs/emulator @<avd-name> -gpu mesa

Unfortunately, this currently fails with the following error
code:

    Mesa 10.4.2 implementation error: Unexpected format PIPE_FORMAT_R8G8B8_UNORM in st_new_renderbuffer_fb

The reason for this seems to be internal to OSMesa, and a solution
will be investigated later. The patch should not change the behaviour
of the current 'mesa' emulation mode if ANDROID_EGL_ENGINE is not
defined in your environment.

Change-Id: I47e6458d6024fb875ebf5fca9dc3fafa094a542c
5 files changed