summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Sl <arun.sl@tcs.com>2014-03-01 07:44:59 -0800
committerChad Versace <chad.versace@linux.intel.com>2014-03-01 08:04:36 -0800
commit8e8c2456e1494647e7385915178478bec1036970 (patch)
tree732b2bfb43a60d510c98cc473c8f1ea303ba11d0 /src
parent0009b5d0d2f002f1705e168735a494f957633ee6 (diff)
android: Fix build for Android 4.1
The signature of SurfaceComposerClient::createSurface() changed from Android 4.1 to 4.2. Tested-by: Juha-Pekka Heikkilä <juha-pekka.heikkila@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/waffle/android/droid_surfaceflingerlink.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/waffle/android/droid_surfaceflingerlink.cpp b/src/waffle/android/droid_surfaceflingerlink.cpp
index 6a12fd1..765f70f 100644
--- a/src/waffle/android/droid_surfaceflingerlink.cpp
+++ b/src/waffle/android/droid_surfaceflingerlink.cpp
@@ -105,11 +105,22 @@ droid_setup_surface(
if (pANWContainer == NULL)
goto error;
+ // The signature of SurfaceComposerClient::createSurface() differs across
+ // Android versions.
+#if WAFFLE_ANDROID_MAJOR_VERSION >= 4 && \
+ WAFFLE_ANDROID_MINOR_VERSION >= 2
pANWContainer->surface_control =
pSFContainer->composer_client->createSurface(
String8("Waffle Surface"),
droid_magic_surface_width, droid_magic_surface_height,
PIXEL_FORMAT_RGB_888, 0);
+#else
+ pANWContainer->surface_control =
+ pSFContainer->composer_client->createSurface(
+ String8("Waffle Surface"), 0,
+ droid_magic_surface_width, droid_magic_surface_height,
+ PIXEL_FORMAT_RGB_888, 0);
+#endif
if (pANWContainer->surface_control == NULL) {
wcore_errorf(WAFFLE_ERROR_UNKNOWN,