1
0
Fork 0

[fixed-to-float-patches] Updates the patches in line with the last merge

Most of the patches updated weren't failing but there were a number of
hunk offsets when applying so it tidies that up. The change in
mtx_transform.0.patch has been moved to clutter-actor.c.0.patch.
This commit is contained in:
Robert Bragg 2009-01-08 13:10:32 +00:00
parent 378ca42d5b
commit 012b169a73
6 changed files with 85 additions and 59 deletions

View file

@ -1,8 +1,17 @@
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index ac9a2f6..42da2a5 100644
index 8db8206..f4cec66 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -866,8 +866,11 @@ clutter_actor_transform_point (ClutterActor *actor,
@@ -806,7 +806,7 @@ static inline void
mtx_transform (const ClutterFixed m[],
fixed_vertex_t *vertex)
{
- ClutterFixed _x, _y, _z, _w;
+ float _x, _y, _z, _w;
_x = vertex->x;
_y = vertex->y;
@@ -846,8 +846,11 @@ mtx_transform (const ClutterFixed m[],
/* Help macros to scale from OpenGL <-1,1> coordinates system to our
* X-window based <0,window-size> coordinates
*/
@ -15,8 +24,8 @@ index ac9a2f6..42da2a5 100644
+ (v1)) + (v2))
#define MTX_GL_SCALE_Z(z,w,v1,v2) (MTX_GL_SCALE_X ((z), (w), (v1), (v2)))
/**
@@ -3213,8 +3214,8 @@ clutter_actor_get_preferred_width (ClutterActor *self,
/* transforms a 4-tuple of coordinates using @matrix and
@@ -3244,8 +3247,8 @@ clutter_actor_get_preferred_width (ClutterActor *self,
if (natural_width < min_width)
{
@ -27,7 +36,7 @@ index ac9a2f6..42da2a5 100644
G_OBJECT_TYPE_NAME (self),
natural_width, CLUTTER_UNITS_TO_DEVICE (natural_width),
min_width, CLUTTER_UNITS_TO_DEVICE (min_width));
@@ -3283,8 +3284,8 @@ clutter_actor_get_preferred_height (ClutterActor *self,
@@ -3314,8 +3317,8 @@ clutter_actor_get_preferred_height (ClutterActor *self,
if (natural_height < min_height)
{

View file

@ -1,8 +1,8 @@
diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c
index 3e4df4d..d508631 100644
index 60ef0d3..dda0f6c 100644
--- a/clutter/clutter-alpha.c
+++ b/clutter/clutter-alpha.c
@@ -694,6 +694,11 @@ clutter_ramp_func (ClutterAlpha *alpha,
@@ -697,6 +697,11 @@ clutter_ramp_func (ClutterAlpha *alpha,
}
}
@ -13,8 +13,8 @@ index 3e4df4d..d508631 100644
+ */
static guint32
sincx1024_func (ClutterAlpha *alpha,
ClutterAngle angle,
@@ -713,7 +718,7 @@ sincx1024_func (ClutterAlpha *alpha,
float angle,
@@ -716,7 +721,7 @@ sincx1024_func (ClutterAlpha *alpha,
x -= (512 * 512 / angle);
@ -23,7 +23,7 @@ index 3e4df4d..d508631 100644
* CLUTTER_ALPHA_MAX_ALPHA;
sine = sine >> COGL_FIXED_Q;
@@ -721,11 +726,6 @@ sincx1024_func (ClutterAlpha *alpha,
@@ -724,11 +729,6 @@ sincx1024_func (ClutterAlpha *alpha,
return sine;
}
@ -35,7 +35,7 @@ index 3e4df4d..d508631 100644
static guint32
sincx_func (ClutterAlpha *alpha,
ClutterFixed angle,
@@ -744,7 +744,7 @@ sincx_func (ClutterAlpha *alpha,
@@ -747,7 +747,7 @@ sincx_func (ClutterAlpha *alpha,
x = CLUTTER_FIXED_MUL (x, CFX_PI)
- CLUTTER_FIXED_DIV (CFX_PI, angle);
@ -44,7 +44,7 @@ index 3e4df4d..d508631 100644
CLUTTER_NOTE (ALPHA, "sine: %2f\n", CLUTTER_FIXED_TO_DOUBLE (sine));
@@ -803,9 +803,28 @@ guint32
@@ -806,9 +806,28 @@ guint32
clutter_sine_func (ClutterAlpha *alpha,
gpointer dummy)
{
@ -75,7 +75,7 @@ index 3e4df4d..d508631 100644
/* 2.0 above represents full circle */
return sincx1024_func (alpha, 1024, 1.0);
#endif
@@ -839,18 +858,17 @@ clutter_sine_inc_func (ClutterAlpha *alpha,
@@ -842,18 +861,17 @@ clutter_sine_inc_func (ClutterAlpha *alpha,
ClutterTimeline * timeline;
gint frame;
gint n_frames;
@ -89,17 +89,17 @@ index 3e4df4d..d508631 100644
n_frames = clutter_timeline_get_n_frames (timeline);
- x = 256 * frame / n_frames;
-
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
+ radians = ((float)frame / n_frames) * (G_PI / 2);
+ sine = sinf (radians);
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
-
- return ((guint32) sine) >> COGL_FIXED_Q;
+ return (guint32) (sine * CLUTTER_ALPHA_MAX_ALPHA);
}
/**
@@ -881,18 +899,17 @@ clutter_sine_dec_func (ClutterAlpha *alpha,
@@ -884,18 +902,17 @@ clutter_sine_dec_func (ClutterAlpha *alpha,
ClutterTimeline * timeline;
gint frame;
gint n_frames;
@ -123,7 +123,7 @@ index 3e4df4d..d508631 100644
}
/**
@@ -923,18 +940,17 @@ clutter_sine_half_func (ClutterAlpha *alpha,
@@ -926,18 +943,17 @@ clutter_sine_half_func (ClutterAlpha *alpha,
ClutterTimeline *timeline;
gint frame;
gint n_frames;
@ -137,17 +137,17 @@ index 3e4df4d..d508631 100644
n_frames = clutter_timeline_get_n_frames (timeline);
- x = 512 * frame / n_frames;
-
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
+ radians = ((float)frame / n_frames) * G_PI;
+ sine = sinf (radians);
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
-
- return ((guint32) sine) >> COGL_FIXED_Q;
+ return (guint32) (sine * CLUTTER_ALPHA_MAX_ALPHA);
}
/**
@@ -959,19 +975,20 @@ clutter_sine_in_func (ClutterAlpha *alpha,
@@ -962,19 +978,20 @@ clutter_sine_in_func (ClutterAlpha *alpha,
ClutterTimeline *timeline;
gint frame;
gint n_frames;
@ -174,7 +174,7 @@ index 3e4df4d..d508631 100644
}
/**
@@ -995,18 +1012,17 @@ clutter_sine_out_func (ClutterAlpha *alpha,
@@ -998,18 +1015,17 @@ clutter_sine_out_func (ClutterAlpha *alpha,
ClutterTimeline *timeline;
gint frame;
gint n_frames;
@ -188,17 +188,17 @@ index 3e4df4d..d508631 100644
n_frames = clutter_timeline_get_n_frames (timeline);
- x = 256 * frame / n_frames;
-
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
+ radians = ((float)frame / n_frames) * (G_PI / 2);
+ sine = sinf (radians);
- sine = sinf (x * (G_PI/180.0)) * CLUTTER_ALPHA_MAX_ALPHA;
-
- return ((guint32) sine) >> COGL_FIXED_Q;
+ return (guint32) (sine * CLUTTER_ALPHA_MAX_ALPHA);
}
/**
@@ -1031,18 +1047,20 @@ clutter_sine_in_out_func (ClutterAlpha *alpha,
@@ -1034,18 +1050,20 @@ clutter_sine_in_out_func (ClutterAlpha *alpha,
ClutterTimeline *timeline;
gint frame;
gint n_frames;
@ -224,7 +224,43 @@ index 3e4df4d..d508631 100644
}
/**
@@ -1201,9 +1219,9 @@ clutter_exp_inc_func (ClutterAlpha *alpha,
@@ -1113,30 +1131,23 @@ clutter_smoothstep_inc_func (ClutterAlpha *alpha,
ClutterTimeline *timeline;
gint frame;
gint n_frames;
- guint32 r;
- guint32 x;
+ float r;
+ float x;
/*
* The smoothstep function uses f(x) = -2x^3 + 3x^2 where x is from <0,1>,
- * and precission is critical -- we use 8.24 fixed format for this operation.
- * The earlier operations involve division, which we cannot do in 8.24 for
- * numbers in <0,1> we use ClutterFixed.
+ * and precission is critical.
*/
timeline = clutter_alpha_get_timeline (alpha);
frame = clutter_timeline_get_current_frame (timeline);
n_frames = clutter_timeline_get_n_frames (timeline);
- /*
- * Convert x to 8.24 for next step.
- */
- x = CLUTTER_FIXED_DIV (frame, n_frames) << 8;
+ x = (float)frame / n_frames;
/*
* f(x) = -2x^3 + 3x^2
- *
- * Convert result to ClutterFixed to avoid overflow in next step.
*/
- r = ((x >> 12) * (x >> 12) * 3 - (x >> 15) * (x >> 16) * (x >> 16)) >> 8;
+ r = -2 * x * x * x + 3 * x * x;
return (r * CLUTTER_ALPHA_MAX_ALPHA);
}
@@ -1204,9 +1215,9 @@ clutter_exp_inc_func (ClutterAlpha *alpha,
*
* (2^x_alpha_max) - 1 == CLUTTER_ALPHA_MAX_ALPHA
*/
@ -237,7 +273,7 @@ index 3e4df4d..d508631 100644
timeline = clutter_alpha_get_timeline (alpha);
frame = clutter_timeline_get_current_frame (timeline);
@@ -1211,7 +1229,7 @@ clutter_exp_inc_func (ClutterAlpha *alpha,
@@ -1214,7 +1225,7 @@ clutter_exp_inc_func (ClutterAlpha *alpha,
x = x_alpha_max * frame / n_frames;
@ -246,7 +282,7 @@ index 3e4df4d..d508631 100644
return result;
}
@@ -1252,9 +1270,9 @@ clutter_exp_dec_func (ClutterAlpha *alpha,
@@ -1255,9 +1266,9 @@ clutter_exp_dec_func (ClutterAlpha *alpha,
*
* (2^x_alpha_max) - 1 == CLUTTER_ALPHA_MAX_ALPHA
*/
@ -259,7 +295,7 @@ index 3e4df4d..d508631 100644
timeline = clutter_alpha_get_timeline (alpha);
frame = clutter_timeline_get_current_frame (timeline);
@@ -1262,7 +1280,7 @@ clutter_exp_dec_func (ClutterAlpha *alpha,
@@ -1265,7 +1276,7 @@ clutter_exp_dec_func (ClutterAlpha *alpha,
x = (x_alpha_max * (n_frames - frame)) / n_frames;

View file

@ -1,8 +1,8 @@
diff --git a/clutter/clutter-path.c b/clutter/clutter-path.c
index 973d861..d3eff11 100644
index 6f93402..c459cdf 100644
--- a/clutter/clutter-path.c
+++ b/clutter/clutter-path.c
@@ -1081,11 +1081,11 @@ clutter_path_node_distance (const ClutterKnot *start,
@@ -1217,11 +1217,11 @@ clutter_path_node_distance (const ClutterKnot *start,
* If we are using limited precision sqrti implementation, fallback on
* clib sqrt if the precission would be less than 10%
*/

View file

@ -1,13 +1,13 @@
diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c
index fc5541b..0f1a77e 100644
index 42be677..7273946 100644
--- a/clutter/clutter-texture.c
+++ b/clutter/clutter-texture.c
@@ -457,7 +457,7 @@ clutter_texture_set_fbo_projection (ClutterActor *self)
@@ -463,7 +463,7 @@ clutter_texture_set_fbo_projection (ClutterActor *self)
/* Set up a projection matrix so that the actor will be projected as
if it was drawn at its original location */
- tan_angle = clutter_tani (CLUTTER_ANGLE_FROM_DEGX (perspective.fovy / 2));
+ tan_angle = clutter_tanx (perspective.fovy / 2);
- tan_angle = tanf (COGL_ANGLE_FROM_DEGX (perspective.fovy / 2 * (G_PI/180.0)));
+ tan_angle = tanf ((perspective.fovy / 2) * (G_PI/180.0));
near_size = CLUTTER_FIXED_MUL (perspective.z_near, tan_angle);
cogl_frustum (CLUTTER_FIXED_MUL (x_min, near_size),
cogl_frustum (CLUTTER_FIXED_MUL (tx_min, near_size),

View file

@ -1,17 +1,17 @@
diff --git a/clutter/pango/cogl-pango-render.c b/clutter/pango/cogl-pango-render.c
index 9d1da77..12dfe72 100644
index d8f87fb..3e23309 100644
--- a/clutter/pango/cogl-pango-render.c
+++ b/clutter/pango/cogl-pango-render.c
@@ -58,8 +58,6 @@ struct _CoglPangoRendererClass
PangoRendererClass class_instance;
};
@@ -102,8 +102,6 @@ cogl_pango_renderer_draw_glyph (CoglPangoRenderer *priv,
*(p++) = cache_value->tx2; *(p++) = cache_value->ty2;
}
-#define COGL_PANGO_UNIT_TO_FIXED(x) ((x) << (COGL_FIXED_Q - 10))
-
static void cogl_pango_renderer_finalize (GObject *object);
static void cogl_pango_renderer_draw_glyphs (PangoRenderer *renderer,
PangoFont *font,
@@ -393,8 +391,8 @@ cogl_pango_renderer_get_device_units (PangoRenderer *renderer,
@@ -439,8 +437,8 @@ cogl_pango_renderer_get_device_units (PangoRenderer *renderer,
}
else
{

View file

@ -1,19 +0,0 @@
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index cc56310..4c89c0f 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -781,11 +781,10 @@ clutter_actor_real_allocate (ClutterActor *self,
/* Transform point (x,y,z) by matrix */
static void
-mtx_transform (ClutterFixed m[16],
- ClutterFixed *x, ClutterFixed *y, ClutterFixed *z,
- ClutterFixed *w)
+mtx_transform (float m[16],
+ float *x, float *y, float *z, float *w)
{
- ClutterFixed _x, _y, _z, _w;
+ float _x, _y, _z, _w;
_x = *x;
_y = *y;
_z = *z;