Home | History | Annotate | Download | only in vega

Lines Matching full: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));
88 poly->data = malloc(sizeof(float) * COMPONENTS * size);
89 poly->size = size;
90 poly->num_verts = 0;
91 poly->dirty = VG_TRUE;
92 poly->user_vbuf = NULL;
94 return poly;
99 struct polygon *poly = polygon_create(size);
101 memcpy(poly->data, data, sizeof(float) * COMPONENTS * size);
102 poly->num_verts = size;
103 poly->dirty = VG_TRUE;
104 poly->user_vbuf = NULL;
106 return poly;
109 void polygon_destroy(struct polygon *poly)
111 free(poly->data);
112 free(poly);
115 void polygon_resize(struct polygon *poly, int new_size)
119 sizeof(float) * COMPONENTS * poly->size);
120 memcpy(data, poly->data, size);
121 free(poly->data);
122 poly->data = data;
123 poly->size = new_size;
124 poly->dirty = VG_TRUE;
127 int polygon_size(struct polygon *poly)
129 return poly->size;
132 int polygon_vertex_count(struct polygon *poly)
134 return poly->num_verts;
137 float * polygon_data(struct polygon *poly)
139 return poly->data;
245 struct polygon *poly)
249 /*polygon_print(poly);*/
253 if (poly->user_vbuf == NULL || poly->dirty) {
254 poly->screen = pipe->screen;
255 poly->user_vbuf = poly->data;
256 poly->dirty = VG_FALSE;
260 void polygon_fill(struct polygon *poly, struct vg_context *ctx)
267 assert(poly);
268 polygon_bounding_rect(poly, bounds);
275 debug_printf("Poly bounds are [%f, %f], [%f, %f]\n",
279 polygon_prepare_buffer(ctx, poly);
290 vbuffer.user_buffer = poly->user_vbuf;
296 PIPE_PRIM_TRIANGLE_FAN, 0, (VGuint) poly->num_verts);
317 debug_printf("%s: Poly bounds are [%f, %f], [%f, %f]\n",
337 struct polygon *poly = (((struct polygon**)polys->data)[i]);
339 polygon_prepare_buffer(ctx, poly);
340 vbuffer.user_buffer = poly->user_vbuf;
343 PIPE_PRIM_TRIANGLE_FAN, 0, (VGuint) poly->num_verts);