I have a simple performance question related to animation based on mouse movement in an activity.
When you move the mouse, a colored rectangle follows the mouse around. When you click with the mouse, we change the way in which we get the mouse coordinates to position the colored rectangle (and change the color too): if (self.opt2): #green ... fast on, xx, yy, mod = gtk.gdk.Display.get_pointer( gtk.gdk.display_get_default() ) self.fake_cursor.x = xx self.fake_cursor.y = yy else: #red ... slow #self.mouse_x and self.mouse_y are updated via motion_notify_event callbacks. self.fake_cursor.x = self.mouse_x self.fake_cursor.y = self.mouse_y Here is a video showing the performance hit in both f13 yummed sugar (mistakenly called jhbuild in the video) and on an xo: http://www.youtube.com/watch?v=dq9_k1vyrLA Here is the sample activity source: http://alumni.media.mit.edu/~erikb/tmp/Test.activity.xo<http://alumni.media.mit.edu/%7Eerikb/tmp/Test.activity.xo> I don't understand the poor performance when using the self.mouse_x and self.mouse_y variables. Shouldn't these two ways of positioning the cursor behave identically?
_______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel