android/skin: Adding unit test suite.

This patch adds a new unit test program (android_skin_unittests +
its 64-bit variant) to run unit tests specific to the existing UI
code. More tests will follow, including non-unit tests to verify
that everything works properly without starting a full emulation
session.

+ Fix a few minor bugs in android/skin/keycode.c that were caught
  with it.

Change-Id: Iddcaa757bab42c969562c09c572c2db85702361f
android/skin/keycode-buffer.c: Add unit test.

Change-Id: Ib0aef210647fbbb622fd879273d5e57ea7766798
Rename skin_keycodes_buffer_xxx -> skin_keycode_buffer_xxx

Simple renaming of the function prefix to match the proper type
declaration (i.e. SkinKeycodeBuffer).

Change-Id: Ic45092db9bd8e81462f96580d6e741bdc72120a2
android/skin/rect.h: Add unit test + fix skin_rect_equals

Add unit tests for all functions declared in android/skin/rect.h
and fix the implementation of skin_rect_equals() which failed
to properly check the height of both rectangles!

Change-Id: If224639fbe0810ead08d3cc90fcf0ab16c3ff937
android/skin/region.h: Add unit tests.

This patch adds unit tests for the android skin region code
+ add a few 'const' here and there. The tests are not extensive
yet but a good start. More might follow later.

Change-Id: Iee1ab4639602869ee2d3d271714a638cbd3278c2
android-emugl: Change assert() into simple warnings.

We still have random crashes in the GPU emulation library that occur
when one does certain things. For example, emulating a JB 4.2 x86
system image, launching a video on the YouTube web page from the
browser application nearly always triggers an assert() about a
generic pointer that should fit on 32-bits, but doesn't actually.

This patch changes the assert() call into a simple warning, to
ensure the emulator continues to run in such events. There is no
noticeable effect on the rendering, but there is likely another
bug at play which is currently very hard to spot.

Change-Id: I6691e00755eb9408a6584b02fcdd9181ad9e2685
android-emugl: Cleanup EglThreadInfo.h

Small cleanup of the source file to improve documentation and
remove obsolete elements.

Change-Id: Id55eff3431fdc3df3055e25f9f62288b5aaff678
android/utils/debug.c: Initialize android_verbose.

This initializes the global value |android_verbose| to 0 in its
definition, to avoid runtime link-error on OS X.

Change-Id: I8ec8e241c3a2ecc69bf6e01046f154e3ac88fcc6
android-emugl: Cleanup EglGlobalInfo

This patch cleans up the EglGlobalInfo class definition, and adds
documentation. Remove the map of EglDisplay -> EGLNativeDisplayType,
a simple vector is sufficient, as long as the EGLNativeDisplayType
is pushed to the EglDisplay class.

+ Add missing const here and there to make the code a little more
  robust.

Change-Id: I18c7d52db6fd7cf0baef2aa08838dc1005bcfb21
android-emugl: Cleanup EglConfig definition.

This patch cleans up the EglConfig declarations and definitions
and adds some documentation to its methods.

+ Fix a typo (compitableWith -> compatibleWith)
+ Fix another typo (choosen -> chosen)
+ Fix method name (nativeConfig -> nativeFormat)

Change-Id: Ia8500325a6c8c02188141d8333c6926f7c105373
android-emugl: Minor cleanup of EglValidate.h

Minor formatting cleanup + add some documentation.

Change-Id: I9650ac8e0ead9af749405ae0208a9706d8ce20c8
android-emugl: Fix emugl::Thread stack reclaim.

This patch modifies the emugl::Thread implementation on Posix
systems to properly reclaim the stack when the wait() method
is called after the thread has completed execution.

As a bonus:

- Fix the tryWait() implementation.
- Add a unit test for tryWait() too.

Change-Id: If83f871ecc16f387eec7a491abe4aca23e4e5965
android-emugl: Fix thread stack leakage in RenderThread.

The mechanism used by RenderServer to wait for the end of a thread
was racy (it relies on a variable |m_finished| that is shared between
two threads without synchronization / memory barriers).

Moreover, the variable could be set before the thread was actually
joined and its stack reclaimed, which creates problem in the following
RenderServer code:

            if ((*t)->isFinished()) {
                delete (*t);
                threads.erase(t);
            }

Because the thread could be deleted before the thread was joined / its
stack reclaimed properly, which triggered an assert() in
emugl::Thread::~Thread().

This patch gets rid of the shared variable and uses emugl::Thread::tryWait()
instead to get the same result, while ensuring the thread stack is always
properly reclaimed, getting rid of the assert failures.

Change-Id: I46691db5e7d7223be56ec181d2d21393ca496cfd
Merge changes I46691db5,If83f871e

* changes:
  android-emugl: Fix thread stack leakage in RenderThread.
  android-emugl: Fix emugl::Thread stack reclaim.
Merge "android/utils/debug.c: Initialize android_verbose."
Merge changes I9650ac8e,Ia8500325,I18c7d52d,Id55eff34,I6691e007, ...

* changes:
  android-emugl: Minor cleanup of EglValidate.h
  android-emugl: Cleanup EglConfig definition.
  android-emugl: Cleanup EglGlobalInfo
  android-emugl: Cleanup EglThreadInfo.h
  android-emugl: Change assert() into simple warnings.
  android/skin/region.h: Add unit tests.
  android/skin/rect.h: Add unit test + fix skin_rect_equals
  Rename skin_keycodes_buffer_xxx -> skin_keycode_buffer_xxx
  android/skin/keycode-buffer.c: Add unit test.
  android/skin: Adding unit test suite.