Hey Cedric,

On Wed, Jun 25, 2014 at 11:44 PM, Cedric BAIL <[email protected]> wrote:

> On Wed, Jun 25, 2014 at 2:57 PM, ChunEon Park <[email protected]> wrote:
> > hermet pushed a commit to branch efl-1.10.
> >
> >
> http://git.enlightenment.org/core/efl.git/commit/?id=b2d99524b7fd4e6ef0933bc64443d96f25098eec
> >
> > commit b2d99524b7fd4e6ef0933bc64443d96f25098eec
> > Author: ChunEon Park <[email protected]>
> > Date:   Wed Jun 25 21:46:49 2014 +0900
> >
> >     evas/gl - fix to render grayscale with transparency format in gl
> backened.
> >
> >     In case of png, grayscale with transparency format (transparency
> doesn't mean the png has alpha channel)
> >     gl doesn't prepare that format render.
> >     In this case, set it argb8888 to convert the data in the png loader.
> >
> >     @fix
>
> I don't understand your commit message. I did test this code with PNG
> GRY8 with and without alpha channel and they did both work. But if you
> really want to disable the support for EVAS_COLORSPACE_AGRY88, you
> should change evas_gl_image.c around line 120 (in the array directly).
> Also it is strange that you end up with a GRY8 with alpha flags being
> set, I am guessing, somewhere in the code we have something playing
> with the flags that doesn't update the colorspace correctly.
>

This is not AGR88, but GRY8 with the alpha flag set in the PNG somehow.
Hermet pushed a few commits before related to this problem (remove the
abort()) as he encountered a PNG image, with only greyscale data, but with
the alpha flag set. The GL texture matching algo failed to find a proper
colorspace (GRY8 means no alpha).

Do you think the PNG loader should convert to AGRY88 at load time in that
case?

In the loader:

   if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) hasa = 1;
   switch (color_type)
     {
      case PNG_COLOR_TYPE_RGB_ALPHA:
         hasa = 1;
         break;
      case PNG_COLOR_TYPE_GRAY_ALPHA:
         hasa = 1;
         prop->cspaces = cspace_grey_alpha;
         break;
      case PNG_COLOR_TYPE_GRAY:
         prop->cspaces = cspace_grey;
         break;
     }
   if (hasa) prop->alpha = 1;

I guess png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) is true but the
color type is PNG_COLOR_TYPE_GRAY.
This would probably mean that the image contains alpha data and not grey.


Best regards,





> >     Conflicts:
> >
> >         src/modules/evas/engines/gl_common/evas_gl_image.c
> > ---
> >  src/modules/evas/engines/gl_common/evas_gl_image.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c
> b/src/modules/evas/engines/gl_common/evas_gl_image.c
> > index 248eb30..d579ada 100644
> > --- a/src/modules/evas/engines/gl_common/evas_gl_image.c
> > +++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
> > @@ -218,6 +218,13 @@ _evas_gl_common_image(Evas_Engine_GL_Context *gc,
> RGBA_Image *im_im, Evas_Image_
> >            }
> >
> >          cspace = im_im->cache_entry.cspaces[i];
> > +
> > +        /* Current GL doesn't support grayscale with transparency
> > +           let it convert to argb8888 in loader */
> > +        if ((cspace == EVAS_COLORSPACE_GRY8) &&
> > +            im_im->cache_entry.flags.alpha)
> > +          cspace = EVAS_COLORSPACE_ARGB8888;
> > +
> >          im_im->cache_entry.space = cspace;
> >       }
> >
> >
> > --
> >
> >
> >
>
>
>
> --
> Cedric BAIL
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>


-- 
Jean-Philippe André
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to