[Sugar-devel] slow animation performance when moving the mouse
Erik Blankinship
erikb at mediamods.com
Tue Aug 31 13:34:29 EDT 2010
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100831/6c277750/attachment.htm
More information about the Sugar-devel
mailing list