return TRUE;
}
-static void
+static void *
glamor_setup_composite_vbo_for_trapezoid(ScreenPtr screen, int n_verts)
{
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glEnableVertexAttribArray(GLAMOR_VERTEX_RIGHT_PARAM);
glamor_put_context(glamor_priv);
+
+ return glamor_priv->vb + glamor_priv->vbo_offset;
}
static Bool
BoxRec one_trap_bound;
int nrect_max;
int i, j;
- float *vertices;
float params[4];
glamor_priv = glamor_get_screen_private(screen);
nrect_max = GLAMOR_COMPOSITE_VBO_VERT_CNT / (4 * GLAMOR_VERTEX_RIGHT_PARAM);
for (i = 0; i < ntrap;) {
+ float *vertices;
int mrect;
int stride;
mrect = (ntrap - i) > nrect_max ? nrect_max : (ntrap - i);
- glamor_setup_composite_vbo_for_trapezoid(screen, 4 * mrect);
+ vertices = glamor_setup_composite_vbo_for_trapezoid(screen, 4 * mrect);
stride = glamor_priv->vb_stride / sizeof(float);
for (j = 0; j < mrect; j++) {
miTrapezoidBounds(1, ptrap, &one_trap_bound);
- vertices =
- (float *) (glamor_priv->vb + glamor_priv->vbo_offset) + 2;
+ vertices += 2;
glamor_set_tcoords_ext((pixmap_priv->base.pixmap->drawable.width),
(pixmap_priv->base.pixmap->drawable.height),
(one_trap_bound.x1), (one_trap_bound.y1),
}
params[2] = right_slope;
glamor_set_const_ext(params, 4, vertices, 4, stride);
+ vertices += 4;
DEBUGF("trap_top = %f, trap_bottom = %f, "
"trap_left_x = %f, trap_left_y = %f, left_slope = %f, "
glamor_priv->render_nr_verts += 4;
glamor_priv->vbo_offset += glamor_priv->vb_stride * 4;
+
+ vertices += 3 * stride;
}
i += mrect;