Hi!

I both tried to make my background larger than the stage (suggested by
Tomas), and test-perspective, but the problem is still there.
Test-perspective was perfect.  But test-perspective is not a real life
test to expose my problem. I modified it to have the problem reproduced.
Basically, I added a rotating image in the middle of the screen and the
problem appeared!

On my Nvidia FX-5200, running the Nvidia driver 1.0.9631 provided by
Ubuntu packages, I had a flashing red 1px ligne at the top of the
screen. It is not the whole line who's flashing, only 66% of it starting
from the right side. I am running Clutter 0.3.1 packaged for Feisty.  Oh
and by the way, Clutter-gst-0.3.1 is missing from the repositories.

This can not be related to Cairo (as I first thought) since their is no
cairo code in this file.  And it might not be perspective related.

Have a look for your self -- my test-perspective is attached

-- Pierre-Luc

Le vendredi 03 août 2007 à 10:11 +0100, Matthew Allum a écrit :
> I think this is a perspective 'bug' or GL feature where the perspective
> is slightly off and thus the stage appears slightly smaller (or larger)
> than the window pixels. I thought we'd fixed this but it could be you
> have a GL implementation that its not fixed for (what driver are you
> using) or your using an older version of clutter ?
> 
> Can you also try running test-perspective and check you see 4 pixels, 1
> in each corner with a 1 pixel border ?
> 
>   -- Matthew
> 
> On Fri, 2007-08-03 at 01:08 -0400, Pierre-Luc Beaudoin wrote:
> > Hi!
> > 
> > I've noticed a rendering bug on my application (Sofa), and I'd like to
> > have your input on what might causing this problem.   After I added a
> > cairo texture for background, when the screen is updated (by a
> > behavior for example), a 1 pixel line would blink at the top of the
> > screen.  At first I though that my cairo texture wasn't big enough but
> > I make it larger than the screen and it didn't change a thing.
> > 
> > Care to give it a look?
> > 
> > The pixel line is white, which is the color of the stage.  It looks
> > like the Cairo texture is redraw and their is a small round error.  I
> > was able to reproduce this on 1024x768 and 1920x1200.
> > 
> > Thanks!
> > 
> > Pierre-Luc
> 
#include <clutter/clutter.h>

// Call back for timeline
void  rotate  (ClutterTimeline *timeline,
               gint             frame_num,
               gpointer         actor) {
  static float angle;
  angle += 0.1;
  ClutterActor * a = CLUTTER_ACTOR(actor);
  clutter_actor_rotate_z(a, angle, clutter_actor_get_width(a)/2.0, clutter_actor_get_height(a)/2.0);
}

int
main (int argc, char *argv[])
{
  ClutterActor    *rect;
  ClutterActor    *stage;
  ClutterColor     red = {0xff, 0, 0, 0xff}, white = {0xff, 0xff, 0xff, 0xff};
  ClutterTimeline * time;
  
  clutter_init (&argc, &argv);

  stage = clutter_stage_get_default ();
  g_object_set (stage, "fullscreen", TRUE, NULL);

  clutter_stage_set_color (CLUTTER_STAGE (stage), &red);
  
  rect = clutter_rectangle_new_with_color (&white);
  clutter_actor_set_size (rect, 
			  clutter_actor_get_width(stage), 
			  clutter_actor_get_height(stage));
  clutter_actor_set_position (rect, 0, 0);
  clutter_group_add (CLUTTER_GROUP (stage), rect);

  rect = clutter_rectangle_new_with_color (&red);
  clutter_actor_set_size (rect, 2, 2);
  clutter_actor_set_position (rect, 1, 1);
  clutter_group_add (CLUTTER_GROUP (stage), rect);

  rect = clutter_rectangle_new_with_color (&red);
  clutter_actor_set_size (rect, 2, 2);
  clutter_actor_set_position (rect, clutter_actor_get_width(stage)-3, 1);
  clutter_group_add (CLUTTER_GROUP (stage), rect);

  rect = clutter_rectangle_new_with_color (&red);
  clutter_actor_set_size (rect, 2, 2);
  clutter_actor_set_position (rect, 1, clutter_actor_get_height(stage)-3);
  clutter_group_add (CLUTTER_GROUP (stage), rect);

  rect = clutter_rectangle_new_with_color (&red);
  clutter_actor_set_size (rect, 2, 2);
  clutter_actor_set_position (rect, 
			      clutter_actor_get_width(stage)-3, 
			      clutter_actor_get_height(stage)-3);
  clutter_group_add (CLUTTER_GROUP (stage), rect);
  
  //Rotating background
  GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file_at_size( 
          "/usr/share/icons/gnome/scalable/places/distributor-logo.svg", 
          clutter_actor_get_width(stage)/2.0, 
          clutter_actor_get_width(stage)/2.0, 
          NULL);
  if (pixbuf){
    rect = clutter_texture_new_from_pixbuf (pixbuf);
    clutter_actor_set_position(rect, 0, 0);
    clutter_actor_set_size(rect, clutter_actor_get_width(stage), clutter_actor_get_width(stage));    
    clutter_actor_set_opacity(rect, 64 );
    clutter_actor_show_all (CLUTTER_ACTOR (rect));
    clutter_group_add (CLUTTER_GROUP (stage), rect);
  } 
  time = clutter_timeline_new (60, 360);
  clutter_timeline_set_loop(time, TRUE);
  g_signal_connect (time, "new-frame", G_CALLBACK (rotate), rect);  
  clutter_timeline_start(time);
  //end of added stuff

  clutter_actor_show_all (CLUTTER_ACTOR (stage));
  clutter_main ();

  return 0;
}

Reply via email to