Re: [clutter] switched colour channels

2010-04-22 Thread Brian J. Tarricone
On 04/21/2010 07:35 AM, Phil wrote:
 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.

I've noticed this as well, and for this reason we're sticking with
clutter 1.0.x for our project.  It seems there are quite a few
regressions to the GLES backend in 1.2 (not to mention that the eglx
backend doesn't work[1]).  I've been meaning to find time to try to
categorize the problems and file bugs, but I've been far too busy.

Glad someone else has noticed the reversed color channel problems, though...

-brian

[1] http://bugzilla.o-hand.com/show_bug.cgi?id=2056 -- shame no one's
looked at my patch.
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] Clutter gradient and text

2010-04-22 Thread Neil Roberts

Hi,

On Sam Wilson tecywiz...@hotmail.com wrote:
 Hello, I hate to bother you all with trivial stuff like this, but I am
 having some serious trouble finding the error in my program.
 
 Essentially, I want to render a shape with a gradient background and a
 text label, so I created an actor that has a single Text actor as a
 child.
 
 The gradient is rendered using a method similar to
 http://lists.o-hand.com/clutter/1787.html written in vala and adapted to
 handle angles.  (Any improvements to this function would also be welcome
 C: )
 
 A screenshot of the incorrect behaviour is located at
 http://sellyourvote.ca/Screenshot-test.png
 
 I know it has something to do with the Text actor, since both rectangles
 render properly if the text is turned off in both of them.

I'm having trouble compiling your Vala sample so I can't test the
theory, but my guess is that the problem is because you're not setting a
material before you paint the gradient. When you paint the first
gradient on the left you will have the material left over from whatever
was painted last in the previous scene. I think in this case that would
be the text. Text is painted using a special material that I think would
break your gradient. The second gradient works because it will use the
material left over from painting the outline.

I think all it needs is this line at the top of your draw_gradient
method:

  Cogl.set_source_color({128, 128, 128, 255})

- Neil
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] Clutter gradient and text

2010-04-22 Thread Sam Wilson
On Thu, 2010-04-22 at 10:31 +0100, Neil Roberts wrote:
 Hi,
 
 On Sam Wilson tecywiz...@hotmail.com wrote:
  Hello, I hate to bother you all with trivial stuff like this, but I am
  having some serious trouble finding the error in my program.
  
  Essentially, I want to render a shape with a gradient background and a
  text label, so I created an actor that has a single Text actor as a
  child.
  
  The gradient is rendered using a method similar to
  http://lists.o-hand.com/clutter/1787.html written in vala and adapted to
  handle angles.  (Any improvements to this function would also be welcome
  C: )
  
  A screenshot of the incorrect behaviour is located at
  http://sellyourvote.ca/Screenshot-test.png
  
  I know it has something to do with the Text actor, since both rectangles
  render properly if the text is turned off in both of them.
 
 I'm having trouble compiling your Vala sample so I can't test the
 theory,

Hmm... Might be the compiler version, I am using a recent build from
git, but 0.8.0 should also be able to compile it fine


  but my guess is that the problem is because you're not setting a
 material before you paint the gradient. When you paint the first
 gradient on the left you will have the material left over from whatever
 was painted last in the previous scene. I think in this case that would
 be the text. Text is painted using a special material that I think would
 break your gradient. The second gradient works because it will use the
 material left over from painting the outline.
 
 I think all it needs is this line at the top of your draw_gradient
 method:
 
   Cogl.set_source_color({128, 128, 128, 255})
 
 - Neil
 

You sir, are a god!  I can't believe that's all I was missing :P

Thanks,
Sam


smime.p7s
Description: S/MIME cryptographic signature