In eglMakeCurrent: a) Remove error message when old and new ctx are same
authormythri.venugopal <mythri.venugopal@samsung.com>
Wed, 15 Jan 2014 14:55:44 +0000 (14:55 +0000)
committermythri.venugopal <mythri.venugopal@samsung.com>
Wed, 15 Jan 2014 14:55:44 +0000 (14:55 +0000)
b) Update references only when old and new ctx are different.

src/modules/fastpath/coregl_fastpath_egl.c

index 864f9f6..c665a53 100644 (file)
@@ -1242,14 +1242,16 @@ fastpath_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLCon
                        goto finish;
                }
 
-               if (tstate->cstate != NULL && tstate->cstate->data != NULL)
-                       _remove_context_ref((GLGlueContext *)tstate->cstate->data, &ctx_list_access_mutex);
+               // Update references only when the contexts are different
+               if(tstate->cstate != gctx->cstate)  {
+                       if (tstate->cstate != NULL && tstate->cstate->data != NULL)
+                               _remove_context_ref((GLGlueContext *)tstate->cstate->data, &ctx_list_access_mutex);
 
-               AST(tstate->cstate != gctx->cstate);
-               tstate->cstate = gctx->cstate;
+                       tstate->cstate = gctx->cstate;
 
-               if (tstate->cstate->data != NULL)
-                       _add_context_ref((GLGlueContext *)tstate->cstate->data);
+                       if (tstate->cstate->data != NULL)
+                               _add_context_ref((GLGlueContext *)tstate->cstate->data);
+               }
 
                tstate->rsurf_draw = draw;
                tstate->rsurf_read = read;