it = drawable_map.find(orig_surface);
if (it != drawable_map.end()) {
- if (it->second != currentDrawable) {
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+ if (!currentContext || it->second != currentContext->drawable) {
// TODO: reference count
delete it->second;
}
static void retrace_eglSwapBuffers(trace::Call &call) {
+ glws::Drawable *drawable = getDrawable(call.arg(1).toUIntPtr());
+
frame_complete(call);
- if (retrace::doubleBuffer && currentDrawable) {
- currentDrawable->swapBuffers();
+ if (retrace::doubleBuffer) {
+ if (drawable) {
+ drawable->swapBuffers();
+ }
} else {
glFlush();
}