[cogl/rstrode/wip/prepare-for-mutter-merge: 8/12] renderer: drop android support



commit af7abf99f22e1422b3f346a188efcb1c0746ac0f
Author: Ray Strode <rstrode redhat com>
Date:   Tue Jan 12 16:53:23 2016 -0500

    renderer: drop android support

 cogl/Makefile.am                              |    5 -
 cogl/cogl-bitmap-pixbuf.c                     |   52 -----
 cogl/cogl-bitmap-private.h                    |   12 --
 cogl/cogl-bitmap.c                            |   16 --
 cogl/cogl-bitmap.h                            |   26 ---
 cogl/cogl-context.h                           |   20 --
 cogl/cogl-renderer.c                          |    6 -
 cogl/cogl-renderer.h                          |    2 -
 cogl/winsys/cogl-winsys-egl-android-private.h |   39 ----
 cogl/winsys/cogl-winsys-egl-android.c         |  253 -------------------------
 configure.ac                                  |   23 ---
 11 files changed, 0 insertions(+), 454 deletions(-)
---
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index b88d502..c1cc10a 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -473,11 +473,6 @@ cogl_sources_c += \
        winsys/cogl-winsys-egl-x11.c \
        winsys/cogl-winsys-egl-x11-private.h
 endif
-if SUPPORT_EGL_PLATFORM_ANDROID
-cogl_sources_c += \
-       winsys/cogl-winsys-egl-android.c \
-       winsys/cogl-winsys-egl-android-private.h
-endif
 if SUPPORT_EGL
 cogl_experimental_h += cogl-egl.h
 cogl_nodist_experimental_h += cogl-egl-defines.h
diff --git a/cogl/cogl-bitmap-pixbuf.c b/cogl/cogl-bitmap-pixbuf.c
index c1e99db..777a523 100644
--- a/cogl/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl-bitmap-pixbuf.c
@@ -420,56 +420,4 @@ _cogl_bitmap_from_file (CoglContext *ctx,
                                            error);
 }
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-CoglBitmap *
-_cogl_android_bitmap_new_from_asset (CoglContext *ctx,
-                                     AAssetManager *manager,
-                                     const char *filename,
-                                     CoglError **error)
-{
-  AAsset *asset;
-  const void *data;
-  off_t len;
-  int stb_pixel_format;
-  int width;
-  int height;
-  uint8_t *pixels;
-  CoglBitmap *bmp;
-
-  asset = AAssetManager_open (manager, filename, AASSET_MODE_BUFFER);
-  if (!asset)
-    {
-      _cogl_set_error_literal (error,
-                               COGL_BITMAP_ERROR,
-                               COGL_BITMAP_ERROR_FAILED,
-                               "Failed to open asset");
-      return NULL;
-    }
-
-  data = AAsset_getBuffer (asset);
-  if (!data)
-    {
-      _cogl_set_error_literal (error,
-                               COGL_BITMAP_ERROR,
-                               COGL_BITMAP_ERROR_FAILED,
-                               "Failed to ::getBuffer from asset");
-      return NULL;
-    }
-
-  len = AAsset_getLength (asset);
-
-  pixels = stbi_load_from_memory (data, len,
-                                  &width, &height,
-                                  &stb_pixel_format, STBI_default);
-
-  bmp = _cogl_bitmap_new_from_stb_pixels (ctx, pixels, stb_pixel_format,
-                                          width, height,
-                                          error);
-
-  AAsset_close (asset);
-
-  return bmp;
-}
-#endif
-
 #endif
diff --git a/cogl/cogl-bitmap-private.h b/cogl/cogl-bitmap-private.h
index 8b29433..676729d 100644
--- a/cogl/cogl-bitmap-private.h
+++ b/cogl/cogl-bitmap-private.h
@@ -37,10 +37,6 @@
 #include "cogl-buffer.h"
 #include "cogl-bitmap.h"
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-#include <android/asset_manager.h>
-#endif
-
 struct _CoglBitmap
 {
   CoglObject _parent;
@@ -126,14 +122,6 @@ _cogl_bitmap_from_file (CoglContext *ctx,
                         const char *filename,
                        CoglError **error);
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-CoglBitmap *
-_cogl_android_bitmap_new_from_asset (CoglContext *ctx,
-                                     AAssetManager *manager,
-                                     const char *filename,
-                                     CoglError **error);
-#endif
-
 CoglBool
 _cogl_bitmap_unpremult (CoglBitmap *dst_bmp,
                         CoglError **error);
diff --git a/cogl/cogl-bitmap.c b/cogl/cogl-bitmap.c
index 5b2aa8e..fbeb2d1 100644
--- a/cogl/cogl-bitmap.c
+++ b/cogl/cogl-bitmap.c
@@ -332,22 +332,6 @@ cogl_bitmap_new_with_size (CoglContext *context,
   return bitmap;
 }
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-CoglBitmap *
-cogl_android_bitmap_new_from_asset (CoglContext *ctx,
-                                    AAssetManager *manager,
-                                    const char *filename,
-                                    CoglError **error)
-{
-  _COGL_RETURN_VAL_IF_FAIL (ctx != NULL, NULL);
-  _COGL_RETURN_VAL_IF_FAIL (manager != NULL, NULL);
-  _COGL_RETURN_VAL_IF_FAIL (filename != NULL, NULL);
-  _COGL_RETURN_VAL_IF_FAIL (error == NULL || *error == NULL, NULL);
-
-  return _cogl_android_bitmap_new_from_asset (ctx, manager, filename, error);
-}
-#endif
-
 CoglPixelFormat
 cogl_bitmap_get_format (CoglBitmap *bitmap)
 {
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index 13b5cd2..2ef5299 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -48,10 +48,6 @@ typedef struct _CoglBitmap CoglBitmap;
 #include <glib-object.h>
 #endif
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-#include <android/asset_manager.h>
-#endif
-
 COGL_BEGIN_DECLS
 
 #ifdef COGL_HAS_GTYPE_SUPPORT
@@ -91,28 +87,6 @@ CoglBitmap *
 cogl_bitmap_new_from_file (const char *filename,
                            CoglError **error);
 
-#ifdef COGL_HAS_ANDROID_SUPPORT
-/**
- * cogl_android_bitmap_new_from_asset:
- * @context: A #CoglContext
- * @manager: An Android Asset Manager.
- * @filename: The file name for the asset
- * @error: A return location for a CoglError exception.
- *
- * Loads an Android asset into a newly allocated #CoglBitmap.
- *
- * Return value: (transfer full): A newly allocated #CoglBitmap
- *               holding the image data of the specified asset.
- *
- * Since: 2.0
- */
-CoglBitmap *
-cogl_android_bitmap_new_from_asset (CoglContext *context,
-                                    AAssetManager *manager,
-                                    const char *filename,
-                                    CoglError **error);
-#endif
-
 #if defined (COGL_ENABLE_EXPERIMENTAL_API)
 
 /**
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index 07badeb..5294817 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -49,9 +49,6 @@ typedef struct _CoglContext CoglContext;
 #ifdef COGL_HAS_GTYPE_SUPPORT
 #include <glib-object.h>
 #endif
-#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
-#include <android/native_window.h>
-#endif
 
 COGL_BEGIN_DECLS
 
@@ -163,23 +160,6 @@ cogl_context_get_display (CoglContext *context);
 CoglRenderer *
 cogl_context_get_renderer (CoglContext *context);
 
-#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
-/**
- * cogl_android_set_native_window:
- * @window: A native Android window
- *
- * Allows Android applications to inform Cogl of the native window
- * that they have been given which Cogl can render too. On Android
- * this API must be used before creating a #CoglRenderer, #CoglDisplay
- * and #CoglContext.
- *
- * Since: 1.8
- * Stability: unstable
- */
-void
-cogl_android_set_native_window (ANativeWindow *window);
-#endif
-
 /**
  * cogl_is_context:
  * @object: An object or %NULL
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index 0f0390d..5bb1eaf 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -60,9 +60,6 @@
 #ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
 #include "cogl-winsys-egl-kms-private.h"
 #endif
-#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
-#include "cogl-winsys-egl-android-private.h"
-#endif
 #ifdef COGL_HAS_GLX_SUPPORT
 #include "cogl-winsys-glx-private.h"
 #endif
@@ -180,9 +177,6 @@ static CoglWinsysVtableGetter _cogl_winsys_vtable_getters[] =
 #ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
   _cogl_winsys_egl_kms_get_vtable,
 #endif
-#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
-  _cogl_winsys_egl_android_get_vtable,
-#endif
   _cogl_winsys_stub_get_vtable,
 };
 
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index dd9e9fd..268a1a0 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -164,7 +164,6 @@ cogl_renderer_new (void);
  * @COGL_WINSYS_ID_EGL_NULL: Use EGL with the PowerVR NULL window system
  * @COGL_WINSYS_ID_EGL_WAYLAND: Use EGL with the Wayland window system
  * @COGL_WINSYS_ID_EGL_KMS: Use EGL with the KMS platform
- * @COGL_WINSYS_ID_EGL_ANDROID: Use EGL with the Android platform
  *
  * Identifies specific window system backends that Cogl supports.
  *
@@ -180,7 +179,6 @@ typedef enum
   COGL_WINSYS_ID_EGL_NULL,
   COGL_WINSYS_ID_EGL_WAYLAND,
   COGL_WINSYS_ID_EGL_KMS,
-  COGL_WINSYS_ID_EGL_ANDROID,
 } CoglWinsysID;
 
 /**
diff --git a/configure.ac b/configure.ac
index a52880a..eecf4b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -862,29 +862,6 @@ AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
 AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
                [test "x$enable_wayland_egl_server" = "xyes"])
 
-dnl Android EGL platform
-AC_ARG_ENABLE(
-  [android-egl-platform],
-  [AC_HELP_STRING([--enable-android-egl-platform=@<:@no/yes@:>@], [Enable support for the Android egl 
platform @<:@default=no@:>@])],
-  [],
-  enable_android_egl_platform=no
-)
-AS_IF([test "x$enable_android_egl_platform" = "xyes"],
-      [
-        EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
-        NEED_EGL=yes
-        EGL_PLATFORMS="$EGL_PLATFORMS android"
-
-        AC_CHECK_HEADER([android/native_window.h],
-                        [],
-                        [AC_MSG_ERROR([Unable to locate android/native_window.h])])
-
-        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT"
-      ])
-AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_ANDROID,
-               [test "x$enable_android_egl_platform" = "xyes"])
-
-
 dnl This should go last, since it's the default fallback and we need
 dnl to check the value of $EGL_PLATFORM_COUNT here.
 AC_ARG_ENABLE(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]