[PATCH] Android: Port eglretracer for Android

Chad Versace chad.versace at linux.intel.com
Mon Aug 5 10:07:06 PDT 2013


On 07/31/2013 07:21 AM, Juha-Pekka Heikkila wrote:
> Port eglretracer for Android using Waffle library. To build for
> Android the Android source tree is needed for Waffle. Waffle
> need to be build first, Waffle can be obtained from:
> http://cgit.freedesktop.org/~chadversary/waffle/
>
> If Android source tree is not available/only NDK is present
> egltrace.so and related will only be build, eglretracer will
> be skipped.
>
> Known issues:
> eglretracer seem to launch multiple windows with some traces from
> Android. These multiple windows sometimes segfault on Android,
> need to look into this yet. I remember SurfaceFlinger wasn't
> maybe too happy with such behaviour.
>
> Signed-off-by: Juha-Pekka Heikkila <juha-pekka.heikkila at linux.intel.com>
> ---
>   cmake/FindWaffle.cmake  |  38 +++++++++
>   retrace/CMakeLists.txt  |  26 ++++++
>   retrace/glws_waffle.cpp | 214 ++++++++++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 278 insertions(+)
>   create mode 100644 cmake/FindWaffle.cmake
>   create mode 100644 retrace/glws_waffle.cpp



> +Drawable *
> +createDrawable(const Visual *visual, int width, int height, bool pbuffer)
> +{
> +    struct waffle_window *window;
> +    const WaffleVisual *waffleVisual =
> +        static_cast<const WaffleVisual *>(visual);
> +
> +    window = waffle_window_create(waffleVisual->config, width, height);
> +    return new WaffleDrawable(visual, width, height, pbuffer, window);
> +}
> +
> +Context *
> +createContext(const Visual *visual, Context *shareContext, Profile profile,
> +              bool debug)
> +{


The parameter 'shareContext' is ignored here. If shareContext is non-null,
then this function should log and error than abort, or, preferably, handle
the shareContext correctly by passing it to waffle_context_create().


> +    struct waffle_context *context;
> +    const WaffleVisual *waffleVisual =
> +        static_cast<const WaffleVisual *>(visual);
> +
> +    context = waffle_context_create(waffleVisual->config, NULL);
> +    if (!context) {
> +        os::log("Error in %s waffle_context_create(config, NULL)\n",
> +               __FILE__);
> +
> +        os::abort();
> +        return NULL;
> +    }
> +    return new WaffleContext(visual, profile, context);
> +}


Other than the shareContext issue, I reviewed the usage of the Waffle API, and it
looks good.



More information about the apitrace mailing list