Bug 68378 - subsurfaces demo should call eglMakeCurrent for triangle subsurface
Summary: subsurfaces demo should call eglMakeCurrent for triangle subsurface
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: 1.0.x
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-21 11:29 UTC by Stanislav Vorobiov
Modified: 2013-08-29 05:56 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Stanislav Vorobiov 2013-08-21 11:29:05 UTC
When using cairo-gl non-triangle 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.

Workaround:
Add eglMakeCurrent(tri->egl->dpy, tri->egl_surface, tri->egl_surface, tri->egl->ctx) before glViewport(0, 0, tri->width, tri->height) in triangle_frame_callback
Comment 1 Rob Bradford 2013-08-27 10:40:57 UTC
Hi Pekka/Tomeu - could you look into this please?
Comment 2 Pekka Paalanen 2013-08-27 11:30:06 UTC
Stanislav, are you actually using cairo-gl and not cairo-glesv2?

Anyway, the description and the proposed solution sound good.

I suspect this has gone unnoticed before, because people rarely build Cairo with GLESv2, and that's only case where this can happen. Cairo with GL will explode anyway (and the build system refuses to build subsurfaces demo), and Cairo-image does not touch EGL.

Rob, thanks for the heads-up. We are pretty busy here, and personally I'm way behind in all email on the lists. If anyone submits that patch, you have my ack. I won't have time to touch it this week.
Comment 3 Stanislav Vorobiov 2013-08-27 17:11:13 UTC
Pekka, I'm using cairo-glesv2.

>If anyone submits that patch, you have my ack. I won't have time to touch it 
>this week.
I guess I'll be able to submit this patch tomorrow
Comment 4 Kristian Høgsberg 2013-08-29 05:56:31 UTC
commit 6346e501ac4146b3fdff8d36ef575e5fbbd96e34
Author: Stanislav Vorobiov <s.vorobiov@samsung.com>
Date:   Wed Aug 28 10:14:35 2013 +0400

    subsurfaces: fix rendering problem with cairo-glesv2
    
    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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.