Esempio n. 1
0
XA_EXPORT void
xa_composite_rect(struct xa_context *ctx,
		  int srcX, int srcY, int maskX, int maskY,
		  int dstX, int dstY, int width, int height)
{
    if (ctx->num_bound_samplers == 0 ) { /* solid fill */
	renderer_solid(ctx, dstX, dstY, dstX + width, dstY + height,
		       ctx->solid_color);
    } else {
	const struct xa_composite *comp = ctx->comp;
	int pos[6] = {srcX, srcY, maskX, maskY, dstX, dstY};
	const float *src_matrix = NULL;
	const float *mask_matrix = NULL;

	xa_scissor_update(ctx, dstX, dstY, dstX + width, dstY + height);

	if (comp->src->has_transform)
	    src_matrix = comp->src->transform;
	if (comp->mask && comp->mask->has_transform)
	    mask_matrix = comp->mask->transform;

	renderer_texture(ctx, pos, width, height,
			 src_matrix, mask_matrix);
    }
}
Esempio n. 2
0
XA_EXPORT void
xa_copy(struct xa_context *ctx,
	int dx, int dy, int sx, int sy, int width, int height)
{
    struct pipe_box src_box;

    xa_scissor_update(ctx, dx, dy, dx + width, dy + height);

    if (ctx->simple_copy) {
	u_box_2d(sx, sy, width, height, &src_box);
	ctx->pipe->resource_copy_region(ctx->pipe,
					ctx->dst->tex, 0, dx, dy, 0,
					ctx->src->tex,
					0, &src_box);
    } else
	renderer_copy(ctx, dx, dy, sx, sy, width, height,
		      (float) ctx->src->tex->width0,
		      (float) ctx->src->tex->height0);
}
Esempio n. 3
0
XA_EXPORT void
xa_solid(struct xa_context *ctx, int x, int y, int width, int height)
{
    xa_scissor_update(ctx, x, y, x + width, y + height);
    renderer_solid(ctx, x, y, x + width, y + height, ctx->solid_color);
}