summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-12-23 14:43:53 -0800
committerVinson Lee <vlee@vmware.com>2009-12-23 14:43:53 -0800
commit15ecd0337e4e4d9d33449bdff014a634e368c7d6 (patch)
tree34886fc829d80f3c05fabdeaf88ef3bf209c59be /src/gallium
parent1b0ab3e3c9bd1a57069657bf5126ade2d8d44d30 (diff)
st/vega: Move declaration outside for loop.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/vega/arc.c6
-rw-r--r--src/gallium/state_trackers/vega/bezier.c7
-rw-r--r--src/gallium/state_trackers/vega/vg_context.c3
3 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/vega/arc.c b/src/gallium/state_trackers/vega/arc.c
index e74c7f0334..36cde7ab03 100644
--- a/src/gallium/state_trackers/vega/arc.c
+++ b/src/gallium/state_trackers/vega/arc.c
@@ -537,8 +537,9 @@ static INLINE int num_beziers_needed(struct arc *arc)
double d_eta = (max_eta - min_eta) / n;
if (d_eta <= 0.5 * M_PI) {
double eta_b = min_eta;
+ int i;
found = VG_TRUE;
- for (int i = 0; found && (i < n); ++i) {
+ for (i = 0; found && (i < n); ++i) {
double etaA = eta_b;
eta_b += d_eta;
found = (estimate_error(arc, etaA, eta_b) <= threshold);
@@ -559,6 +560,7 @@ static void arc_to_beziers(struct arc *arc,
sin_eta_b, a_cos_eta_b, b_sin_eta_b, a_sin_eta_b,
b_cos_eta_b, x_b, y_b, x_b_dot, y_b_dot, lx, ly;
double t, alpha;
+ int i;
{ /* always move to the start of the arc */
VGfloat x = arc->x1;
@@ -607,7 +609,7 @@ static void arc_to_beziers(struct arc *arc,
t = tan(0.5 * d_eta);
alpha = sin(d_eta) * (sqrt(4 + 3 * t * t) - 1) / 3;
- for (int i = 0; i < n; ++i) {
+ for (i = 0; i < n; ++i) {
struct bezier bezier;
double xA = x_b;
double yA = y_b;
diff --git a/src/gallium/state_trackers/vega/bezier.c b/src/gallium/state_trackers/vega/bezier.c
index 39a7ade016..d1ee41ac33 100644
--- a/src/gallium/state_trackers/vega/bezier.c
+++ b/src/gallium/state_trackers/vega/bezier.c
@@ -255,7 +255,8 @@ static enum shift_result good_offset(const struct bezier *b1,
const float max_dist_line = threshold*offset*offset;
const float max_dist_normal = threshold*offset;
const float spacing = 0.25;
- for (float i = spacing; i < 0.99; i += spacing) {
+ float i;
+ for (i = spacing; i < 0.99; i += spacing) {
float p1[2],p2[2], d, l;
float normal[2];
bezier_point_at(b1, i, p1);
@@ -341,6 +342,8 @@ static enum shift_result shift(const struct bezier *orig,
float points_shifted[4][2];
float prev_normal[2];
+ int i;
+
points[np][0] = orig->x1;
points[np][1] = orig->y1;
map[0] = 0;
@@ -404,7 +407,7 @@ static enum shift_result shift(const struct bezier *orig,
points_shifted[0][0] = points[0][0] + offset * prev_normal[0];
points_shifted[0][1] = points[0][1] + offset * prev_normal[1];
- for (int i = 1; i < np - 1; ++i) {
+ for (i = 1; i < np - 1; ++i) {
float normal_sum[2], r;
float next_normal[2];
compute_pt_normal(points[i], points[i + 1], next_normal);
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c
index e0ff02f3a9..1572c9f379 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -231,6 +231,7 @@ static void update_clip_state(struct vg_context *ctx)
if (state->scissoring) {
struct pipe_blend_state *blend = &ctx->state.g3d.blend;
struct pipe_framebuffer_state *fb = &ctx->state.g3d.fb;
+ int i;
dsa->depth.writemask = 1;/*glDepthMask(TRUE);*/
dsa->depth.func = PIPE_FUNC_ALWAYS;
dsa->depth.enabled = 1;
@@ -254,7 +255,7 @@ static void update_clip_state(struct vg_context *ctx)
cso_set_blend(ctx->cso_context, blend);
/* enable scissoring */
- for (int i = 0; i < state->scissor_rects_num; ++i) {
+ for (i = 0; i < state->scissor_rects_num; ++i) {
const float x = state->scissor_rects[i * 4 + 0].f;
const float y = state->scissor_rects[i * 4 + 1].f;
const float width = state->scissor_rects[i * 4 + 2].f;