X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glretrace_egl.cpp;h=d7b14ecad6c5e7db5861b42083e1b6b5fd3be2d5;hb=fe806cb6c3a13071126f4eff4bcb8a28d8b0b777;hp=e4178e307e3dfa8bca267ab8aed36c55020a8c03;hpb=993748b1388b5d393588f073d677397eca109f8b;p=apitrace diff --git a/glretrace_egl.cpp b/glretrace_egl.cpp index e4178e3..d7b14ec 100644 --- a/glretrace_egl.cpp +++ b/glretrace_egl.cpp @@ -54,6 +54,9 @@ static ProfileMap profile_map; static unsigned int current_api = EGL_OPENGL_ES_API; static glws::Profile last_profile = glws::PROFILE_COMPAT; +static void +createDrawable(unsigned long long orig_config, unsigned long long orig_surface); + static glws::Drawable * getDrawable(unsigned long long surface_ptr) { if (surface_ptr == 0) { @@ -62,6 +65,13 @@ getDrawable(unsigned long long surface_ptr) { DrawableMap::const_iterator it; it = drawable_map.find(surface_ptr); + if (it == drawable_map.end()) { + // In Fennec we get the egl window surface from Java which isn't + // traced, so just create a drawable if it doesn't exist in here + createDrawable(0, surface_ptr); + it = drawable_map.find(surface_ptr); + assert(it != drawable_map.end()); + } return (it != drawable_map.end()) ? it->second : NULL; } @@ -228,7 +238,7 @@ static void retrace_eglMakeCurrent(trace::Call &call) { static void retrace_eglSwapBuffers(trace::Call &call) { frame_complete(call); - if (double_buffer) { + if (double_buffer && drawable) { drawable->swapBuffers(); } else { glFlush();