Hello,

I have compiled Clutter 1.2.5 with the eglnative/gles backend. The colour
channels of textures seem to be switched when the format is not RGBA.
I have noticed the following:
* if the texture is loaded from a file (e.g. PNG) it works fine (gdk-pixbuf
is
  used). gdk-pixbuf uses RGBA as internal format. Thus, I think it works in
  contrast to the other cases below.
* If I load data from memory using clutter_texture_set_from_rgb_data () the
  issue with the switched red and blue colour channel appears. The flag
  CLUTTER_TEXTURE_RGB_FLAG_BGR does not seem to have an effect.
* If the texture is a cairo texture (cairo uses ARGB internally) the same
  problem is present.

You may also compare an open bug report, where a code example is provided:
http://bugzilla.openedhand.com/show_bug.cgi?id=2059

I had a look at the source code and I assume that at some point the
_cogl_bitmap_fallback_convert () function should be invoked, because OpenGL
ES
does only accept the GL_RGBA format type (and does not provide convertion
facilities). However, the function is not called.
I am wondering if other people experience similar problems like me and the
person who opened the bug report?

Furthermore, can anybody tell me where the convertion should be triggered
ideally? As far as I have seen, the _cogl_texture_prepare_for_upload ()
seems to
be the right place. There also, the GL pixel format conversion is invoked,
which
in turn is performed by the gles specific function. However, I am wondering
why
no conversion is triggered there when the CoglPixelFormat does not match the
GL
internal format (since the OpenGL ES does not provide the necessary
conversion)?

I would be glad for any help!
Phil

Reply via email to