Lines Matching refs:poly
70 static void polygon_print(struct polygon *poly)
74 debug_printf("Polygon %p, size = %d\n", poly, poly->num_verts);
75 for (i = 0; i < poly->num_verts; ++i) {
76 vert = ptr_to_vertex(poly->data, i);
86 struct polygon *poly = (struct polygon*)malloc(sizeof(struct polygon)); in polygon_create() local
88 poly->data = malloc(sizeof(float) * COMPONENTS * size); in polygon_create()
89 poly->size = size; in polygon_create()
90 poly->num_verts = 0; in polygon_create()
91 poly->dirty = VG_TRUE; in polygon_create()
92 poly->user_vbuf = NULL; in polygon_create()
94 return poly; in polygon_create()
99 struct polygon *poly = polygon_create(size); in polygon_create_from_data() local
101 memcpy(poly->data, data, sizeof(float) * COMPONENTS * size); in polygon_create_from_data()
102 poly->num_verts = size; in polygon_create_from_data()
103 poly->dirty = VG_TRUE; in polygon_create_from_data()
104 poly->user_vbuf = NULL; in polygon_create_from_data()
106 return poly; in polygon_create_from_data()
109 void polygon_destroy(struct polygon *poly) in polygon_destroy() argument
111 free(poly->data); in polygon_destroy()
112 free(poly); in polygon_destroy()
115 void polygon_resize(struct polygon *poly, int new_size) in polygon_resize() argument
119 sizeof(float) * COMPONENTS * poly->size); in polygon_resize()
120 memcpy(data, poly->data, size); in polygon_resize()
121 free(poly->data); in polygon_resize()
122 poly->data = data; in polygon_resize()
123 poly->size = new_size; in polygon_resize()
124 poly->dirty = VG_TRUE; in polygon_resize()
127 int polygon_size(struct polygon *poly) in polygon_size() argument
129 return poly->size; in polygon_size()
132 int polygon_vertex_count(struct polygon *poly) in polygon_vertex_count() argument
134 return poly->num_verts; in polygon_vertex_count()
137 float * polygon_data(struct polygon *poly) in polygon_data() argument
139 return poly->data; in polygon_data()
245 struct polygon *poly) in polygon_prepare_buffer() argument
253 if (poly->user_vbuf == NULL || poly->dirty) { in polygon_prepare_buffer()
254 poly->screen = pipe->screen; in polygon_prepare_buffer()
255 poly->user_vbuf = poly->data; in polygon_prepare_buffer()
256 poly->dirty = VG_FALSE; in polygon_prepare_buffer()
260 void polygon_fill(struct polygon *poly, struct vg_context *ctx) in polygon_fill() argument
267 assert(poly); in polygon_fill()
268 polygon_bounding_rect(poly, bounds); in polygon_fill()
279 polygon_prepare_buffer(ctx, poly); in polygon_fill()
290 vbuffer.user_buffer = poly->user_vbuf; in polygon_fill()
296 PIPE_PRIM_TRIANGLE_FAN, 0, (VGuint) poly->num_verts); in polygon_fill()
337 struct polygon *poly = (((struct polygon**)polys->data)[i]); in polygon_array_fill() local
339 polygon_prepare_buffer(ctx, poly); in polygon_array_fill()
340 vbuffer.user_buffer = poly->user_vbuf; in polygon_array_fill()
343 PIPE_PRIM_TRIANGLE_FAN, 0, (VGuint) poly->num_verts); in polygon_array_fill()