subsurfaces: fix rendering problem with cairo-glesv2
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Wed, 28 Aug 2013 06:14:35 +0000 (10:14 +0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 29 Aug 2013 05:31:33 +0000 (22:31 -0700)
when using cairo-glesv2 subsurface rendering code
implicitly calls eglMakeCurrent(dpy, NULL, NULL, ctx)
(since EGL_KHR_surfaceless_context is used), thus,
triangle_frame_callback:eglSwapBuffers returns EGL_BAD_SURFACE
error for all invocations other that the first one

clients/subsurfaces.c

index 51b07a2..101ff17 100644 (file)
@@ -398,6 +398,9 @@ triangle_frame_callback(void *data, struct wl_callback *callback,
        if (callback)
                wl_callback_destroy(callback);
 
+       eglMakeCurrent(tri->egl->dpy, tri->egl_surface,
+                                  tri->egl_surface, tri->egl->ctx);
+
        glViewport(0, 0, tri->width, tri->height);
 
        triangle_draw(&tri->gl, tri->time);