natinusala
Posts: 4
Joined: Sun Jun 04, 2017 1:09 pm

Unable to find a config with an alpha mask

Sun Jun 04, 2017 1:13 pm

Hello everyone,

I'm trying to find a config with an alpha mask (to use shapes as a mask when drawing images). This is my current config :

Code: Select all

const EGLint attribute_list[] =
   {
      EGL_RED_SIZE, 8,
      EGL_GREEN_SIZE, 8,
      EGL_BLUE_SIZE, 8,
      EGL_ALPHA_SIZE, 8,
      EGL_DEPTH_SIZE, 16,
      EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
      EGL_NONE
   };
With this configuration, OVG works fine, but obviously this has no support for the alpha mask. I've tried to change the configuration to this :

Code: Select all

const EGLint attribute_list[] =
   {
      EGL_RED_SIZE, 8,
      EGL_GREEN_SIZE, 8,
      EGL_BLUE_SIZE, 8,
      EGL_ALPHA_SIZE, 8,
      EGL_DEPTH_SIZE, 16,
      EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
      EGL_ALPHA_MASK_SIZE, 8, 
      EGL_NONE
   };
But when I do this, eglChooseConfig returns VG_FALSE, with no error (EGL_SUCCESS error code).

Why is that ? How can I have an alpha mask to my surface ? Thanks :)

User avatar
Paeryn
Posts: 1710
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Unable to find a config with an alpha mask

Sat Jul 08, 2017 11:18 pm

I know this is a bit of a late reply (only just seen the post).

Why are you asking for a 16 bit depth buffer in OpenVG? OpenVG is 2D only so a depth buffer makes no sense, take that out and you should be allowed the alpha mask. eglChooseConfig() failed when you asked for both a depth buffer and an alpha mask buffer because there is no config that has both a depth buffer and an alpha mask buffer. If you had queried the number of configs available matching your attributes you would have seen that there were none.

Code: Select all

const EGLint attribute_list[] =
   {
      EGL_RED_SIZE, 8,
      EGL_GREEN_SIZE, 8,
      EGL_BLUE_SIZE, 8,
      EGL_ALPHA_SIZE, 8,
      EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
      EGL_ALPHA_MASK_SIZE, 8,
      EGL_NONE
   };
She who travels light — forgot something.

natinusala
Posts: 4
Joined: Sun Jun 04, 2017 1:09 pm

Re: Unable to find a config with an alpha mask

Sat Jul 08, 2017 11:21 pm

This is because it's a shared config for both VG and GL : I'm using two contexts to draw on the same surface (I swap with eglMakeCurrent).

Should I use a pbuffer to draw my VG stuff to a GL texture instead ? This way I can keep two surfaces with the configuration for each context (depth for GL and alpha for VG)

User avatar
Paeryn
Posts: 1710
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Unable to find a config with an alpha mask

Sun Jul 09, 2017 12:17 am

natinusala wrote:This is because it's a shared config for both VG and GL : I'm using two contexts to draw on the same surface (I swap with eglMakeCurrent).

Should I use a pbuffer to draw my VG stuff to a GL texture instead ? This way I can keep two surfaces with the configuration for each context (depth for GL and alpha for VG)
Ahh... Yes, you'll have to use pbuffers in that case.
She who travels light — forgot something.

natinusala
Posts: 4
Joined: Sun Jun 04, 2017 1:09 pm

Re: Unable to find a config with an alpha mask

Sun Jul 09, 2017 11:35 am

Well that's what I thought. Thanks !

Will it impact the performances a lot ?

User avatar
Paeryn
Posts: 1710
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Unable to find a config with an alpha mask

Sun Jul 09, 2017 12:48 pm

natinusala wrote:Well that's what I thought. Thanks !

Will it impact the performances a lot ?
Not overly I wouldn't think. I've only done OpenVG drawing into a VGImage but no tests as to the speed of it (a static one-time draw into the VGImage right at the start and then using the image multiple times).
She who travels light — forgot something.

natinusala
Posts: 4
Joined: Sun Jun 04, 2017 1:09 pm

Re: Unable to find a config with an alpha mask

Sun Jul 09, 2017 2:16 pm

So far with what I've tested, drawing full resolution VGImages quite slows down the app, I wonder if it's the same for GL textures. I'll have to test it anyway, thanks for the help !

Return to “OpenVG”

Who is online

Users browsing this forum: No registered users and 1 guest