mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 17:00:13 +01:00
st/vega: Move declaration outside for loop.
This commit is contained in:
parent
1b0ab3e3c9
commit
15ecd0337e
3 changed files with 11 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue