Author: miguel
Date: 2007-06-07 11:31:03 -0400 (Thu, 07 Jun 2007)
New Revision: 78852
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/animation.cpp
trunk/moon/src/demo.cpp
trunk/moon/src/runtime.cpp
trunk/moon/src/transform.cpp
Log:
Some debugging aids for the ScaleY problem which causes
repaints to fail due to getboundingbox being busted (it is
really ScaleY that is busted)
2007-06-07 Miguel de Icaza <[EMAIL PROTECTED]>
* animation.cpp (get_now): The time computation was wrong, there
was an extra "10" in there that made all computations go astray
and in particular cause the large values for ScaleY, which made
getboundingbox ridiculously slow.
For debugging purposes: ScaleY was being set to
131472940552.95215, which came from
DoubleAnimation:GetCurrentValue which was computing this value
from a busted clock.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-07 15:26:35 UTC (rev 78851)
+++ trunk/moon/src/ChangeLog 2007-06-07 15:31:03 UTC (rev 78852)
@@ -1,3 +1,15 @@
+2007-06-07 Miguel de Icaza <[EMAIL PROTECTED]>
+
+ * animation.cpp (get_now): The time computation was wrong, there
+ was an extra "10" in there that made all computations go astray
+ and in particular cause the large values for ScaleY, which made
+ getboundingbox ridiculously slow.
+
+ For debugging purposes: ScaleY was being set to
+ 131472940552.95215, which came from
+ DoubleAnimation:GetCurrentValue which was computing this value
+ from a busted clock.
+
2007-06-07 Sebastien Pouliot <[EMAIL PROTECTED]>
* geometry.cpp|h: Add drawing for [Ellipse|Line|Rectangle] geometry.
Modified: trunk/moon/src/animation.cpp
===================================================================
--- trunk/moon/src/animation.cpp 2007-06-07 15:26:35 UTC (rev 78851)
+++ trunk/moon/src/animation.cpp 2007-06-07 15:31:03 UTC (rev 78852)
@@ -18,7 +18,7 @@
guint64 res;
if (gettimeofday (&tv, NULL) == 0) {
- res = ((guint64)tv.tv_sec * 1000000 + tv.tv_usec)*10;
+ res = (guint64)tv.tv_sec * 1000000 + tv.tv_usec;
return res;
}
@@ -109,7 +109,9 @@
autoreverse = timeline_get_autoreverse (timeline);
completed_iterations = 0.0;
-
+ current_progress = 0.0;
+ current_time = 0;
+ start_time = 0;
Duration *duration = timeline_get_duration (timeline);
}
@@ -148,6 +150,10 @@
completed_iterations += 0.5;
current_progress = new_progress - 1.0;
+ guint64 diff = current_time - start_time;
+ printf ("current_time=%llu start_time=%llu
diff=%llu\n", current_time, start_time, diff);
+ printf ("completed_iter=%g autoreverse=%d
duration=%llu\n", completed_iterations, autoreverse, duration_timespan);
+ printf ("Assigning=%g\n", current_progress);
if (remaining_iterations > 0)
remaining_iterations --;
@@ -222,6 +228,7 @@
void
Clock::Begin (guint64 start_time)
{
+ printf ("Starting %llu\n", start_time);
this->start_time = start_time;
current_state = RUNNING; /* should we invalidate the state here? */
QueueEvent (CURRENT_STATE_INVALIDATED);
@@ -503,6 +510,7 @@
if (!targetName)
return;
+ printf ("Got %s %s\n", targetProperty, targetName);
DependencyObject *o = FindName (targetName);
if (!o)
return;
@@ -663,7 +671,9 @@
double progress = animationClock->GetCurrentProgress ();
- return new Value (from + (to-from) * progress);
+ Value *v = new Value (from + (to-from) * progress);
+ // printf ("Sending %g from=%g to=%g progresss=%g\n", v->u.d, from, to,
progress);
+ return v;
}
DoubleAnimation *
Modified: trunk/moon/src/demo.cpp
===================================================================
--- trunk/moon/src/demo.cpp 2007-06-07 15:26:35 UTC (rev 78851)
+++ trunk/moon/src/demo.cpp 2007-06-07 15:31:03 UTC (rev 78852)
@@ -107,6 +107,7 @@
UIElement *e = xaml_create_from_file (file);
if (e == NULL){
printf ("Was not able to load the file\n");
+ return 1;
}
surface_attach (t, e);
@@ -223,8 +224,17 @@
timeline_group_add_child (sb, sy_anim);
storyboard_child_set_target_name (sb, sy_anim,
"scale-transform");
storyboard_child_set_target_property (sb, sy_anim, "ScaleY");
+#if ANIMATION_DEMO
+ //
+ // The animation is currently broken as ScaleY is being set
+ // to an insane value 131472940552.95215, this is set in
+ // DoubleAnimation::GetCurrentValue
+ //
+ // I also updated the get_now routine in animation to compute
+ // microseconds correctly, it was multiplying by 10 too much
sb->Begin ();
+#endif
}
if (do_fps){
t->frames = 0;
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-06-07 15:26:35 UTC (rev 78851)
+++ trunk/moon/src/runtime.cpp 2007-06-07 15:31:03 UTC (rev 78852)
@@ -734,7 +734,7 @@
*copy = value;
if (value.k == Value::STRING)
- copy->u.s = g_strdup (value.u.s);
+ copy->u.s = g_strdup (value.u.s);
if (current_value != NULL && current_value->k >=
Value::DEPENDENCY_OBJECT){
DependencyObject *dob =
current_value->u.dependency_object;
Modified: trunk/moon/src/transform.cpp
===================================================================
--- trunk/moon/src/transform.cpp 2007-06-07 15:26:35 UTC (rev 78851)
+++ trunk/moon/src/transform.cpp 2007-06-07 15:31:03 UTC (rev 78852)
@@ -47,6 +47,7 @@
cairo_matrix_rotate (value, radians);
cairo_matrix_translate (value, center_x, center_y);
}
+ //printf ("Returning2 %g %g %g %g %g %g\n", value->xx, value->yx,
value->xy, value->yy, value->x0, value->y0);
}
RotateTransform *
@@ -104,6 +105,7 @@
double y = translate_transform_get_y (this);
cairo_matrix_init_translate (value, x, y);
+ //printf ("Returning3 %g %g %g %g %g %g\n", value->xx, value->yx,
value->xy, value->yy, value->x0, value->y0);
}
TranslateTransform *
@@ -161,6 +163,8 @@
cairo_matrix_scale (value, sx, sy);
cairo_matrix_scale (value, cx, cy);
}
+ //printf ("translate to %g %g -- %g %g\n", -cx, -cy, sx, sy);
+ //printf ("Returning4 %g %g %g %g %g %g\n", value->xx, value->yx,
value->xy, value->yy, value->x0, value->y0);
}
ScaleTransform *
@@ -184,6 +188,7 @@
void
scale_transform_set_scale_y (ScaleTransform *t, double scaleY)
{
+ printf ("Setting to %g\n", scaleY);
t->SetValue (ScaleTransform::ScaleYProperty, Value(scaleY));
}
@@ -222,11 +227,14 @@
void
MatrixTransform::GetTransform (cairo_matrix_t *value)
{
+ fprintf (stderr, "Error\n");
+ exit (1);
#if notyet
cairo_matrix_t matrix = matrix_transform_get_matrix (this);
memcpy (value, &matrix, sizeof (cairo_matrix_t));
#endif
+ printf ("Returning1 %g %g %g %g %g %g\n", value->xx, value->yx,
value->xy, value->yy, value->x0, value->y0);
}
MatrixTransform *
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches