android/skin/: Add skin_surface_update_scaled()

Better fit for future SDL2 surface backend.

Change-Id: I1c90f7de30ceb4e06e94dbace7a06f636cfa6015
android/skin/: Add skin_surface_upload()

Used to upload the trackball image to its final surface.

Change-Id: I9cf7cf204bb0a5be470706cba0a67d3e77677427
android/skin/window.c: Add SkinSurface for each ADisplay.

This patch ensures that each emulated display (LCD screen) is backed
by its own SkinSurface, whose content is updated when the framebuffer
data changes.

This is done to removie any final use of skin_surface_lock() and
skin_surface_unlock(), relying on skin_surface_upload() instead,
which will allow us to turn on SDL2's accelerated renderers in the
future.

Change-Id: Iafb8ae8129be4c2a616ab8ac4d901a9656f39739
android/skin/surface.h: Remove obsolete functions.

Change-Id: Iebaa58e5e0a1922591c271da5a9fecc7a34763e1
android/skin/scaler.h: Add skin_scaler_free().

Change-Id: Ib106f6595946a91f95208449101d940c748f5420
android/skin/surface.h: Simplify skin_surface_create_argb32_from

Since none of the callers set the |do_copy| parameter, just remove it
with the corresponding support code.

Also remove the |pixels| field from SkinSurface, since it is never
used and duplicates the |surface->pixels| one anyway.

Change-Id: I571428c94ff97f38916edadca61a0deb6dc4c5b1
android/skin/scaler.h: Add skin_scaler_reverse_map().

Change-Id: I06dab9eceab41fe54d1324e4b6fb8888b1fff0fb
android/skin/: Move window scaling to android/skin/surface.h

This moves the code related to scaling the UI window to the surface
support code. This is a preliminary change that will allow GPU-based
scaling when SDL2 will be used.

For now, scaling is still performed in software, including in
full-screen mode.

Change-Id: I4048d5dfe435ec56bdb74ac70a05164425b8e054
distrib/sdl2-2.0.3: New SDL2 sources + build file.

This patch adds the sources for the SDL2 library, as well as
module declarations for emulator_libSDL2 and emulator_lib64SDL2.

The emulator's UI code will be updated to use this library instead
of SDL 1.x in a future patch. Later, the sources for SDL 1.x will
also be removed.

Change-Id: I9d9a19aa0a9f7c00ed68b0ea40ef3916a4714515
Fix emulator on Mac sending message crash issue

Clang uses standard C99 semantics for the "inline" keyword. It is
different from those in GNU C89 mode. In C99, inline means that a
function's definition is provided only for inlining, and that there is
another definition (without inline) somewhere else in the program. That
means that this program is incomplete, because if the function isn't inlined (for
example, when compiling without optimization), it will be
compiled as an external undefined symbol, so as to cause runtime
unresolved symbol error. As the http://clang.llvm.org/compatibility.html
suggested, change the inline function to "static inline".

Change-Id: I0d1d03650c380d8bbfe55ee23cbbe7a0813fd671
Signed-off-by: Xu Zhang <xu.u.zhang@intel.com>
android/skin: Add support for SDL2.

This patch adds support for SDL2 to the android/skin/ sources, and
allows one to compile it when 'EMULATOR_USE_SDL2 == true' in the
environment.

This has been tested succesfully on Linux, when GPU emulation is
disabled. When it is enabled, there is a weird interaction between
the UI window's GL context and the one used by the GPU emulation
library.

A proper fix will have to modify the library to render
into an off-screen texture that will be displayed by the UI
window (currently, the library displayed a sub-window on top
of the regular content instead).

For now, SDL1 is still the default until more testing is
performed.

Change-Id: Ia3a9c9b15db10a4f7374ef4aed97ebdc701abdab
Merge changes Ia3a9c9b1,I9d9a19aa,I4048d5df,I06dab9ec,I571428c9, ...

* changes:
  android/skin: Add support for SDL2.
  distrib/sdl2-2.0.3: New SDL2 sources + build file.
  android/skin/: Move window scaling to android/skin/surface.h
  android/skin/scaler.h: Add skin_scaler_reverse_map().
  android/skin/surface.h: Simplify skin_surface_create_argb32_from
  android/skin/scaler.h: Add skin_scaler_free().
  android/skin/surface.h: Remove obsolete functions.
  android/skin/window.c: Add SkinSurface for each ADisplay.
  android/skin/: Add skin_surface_upload()
  android/skin/: Add skin_surface_update_scaled()
Merge "Fix emulator on Mac sending message crash issue"