From: Juha-Pekka Heikkila <[email protected]> On Android Waffle always fails with EGL_BAD_NATIVE_WINDOW, this fixes that problem.
Signed-off-by: Juha-Pekka Heikkila <[email protected]> --- src/waffle/android/droid_surfaceflingerlink.cpp | 4 ++++ src/waffle/android/droid_window.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/waffle/android/droid_surfaceflingerlink.cpp b/src/waffle/android/droid_surfaceflingerlink.cpp index 472ada7..7272c0d 100644 --- a/src/waffle/android/droid_surfaceflingerlink.cpp +++ b/src/waffle/android/droid_surfaceflingerlink.cpp @@ -49,6 +49,8 @@ struct droid_surfaceflinger_container { }; struct droid_ANativeWindow_container { + // it is important ANativeWindow* is the first element in this structure + ANativeWindow* native_window; sp<SurfaceControl> surface_control; sp<ANativeWindow> window; }; @@ -149,6 +151,8 @@ droid_setup_surface( goto error; } + pANWContainer->native_window = pANWContainer->window.get(); + return pANWContainer; error_closeTransaction: diff --git a/src/waffle/android/droid_window.c b/src/waffle/android/droid_window.c index f03c03a..688b3de 100644 --- a/src/waffle/android/droid_window.c +++ b/src/waffle/android/droid_window.c @@ -55,7 +55,7 @@ droid_window_create(struct wcore_platform *wc_plat, goto error; ok = wegl_window_init(&self->wegl, wc_config, - (intptr_t) self->pANWContainer); + (intptr_t) *((intptr_t*)(self->pANWContainer))); if (!ok) goto error; -- 1.7.5.4 _______________________________________________ waffle mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/waffle

