Example #1
0
void xorg_composite(struct exa_context *exa,
                    struct exa_pixmap_priv *dst,
                    int srcX, int srcY, int maskX, int maskY,
                    int dstX, int dstY, int width, int height)
{
   if (exa->num_bound_samplers == 0 ) { /* solid fill */
      renderer_solid(exa->renderer,
                     dstX, dstY, dstX + width, dstY + height,
                     exa->solid_color);
   } else {
      int pos[6] = {srcX, srcY, maskX, maskY, dstX, dstY};
      float *src_matrix = NULL;
      float *mask_matrix = NULL;

      if (exa->transform.has_src)
         src_matrix = exa->transform.src;
      if (exa->transform.has_mask)
         mask_matrix = exa->transform.mask;

      renderer_texture(exa->renderer,
                       pos, width, height,
                       exa->bound_sampler_views,
                       exa->num_bound_samplers,
                       src_matrix, mask_matrix);
   }
}
Example #2
0
void xorg_solid(struct exa_context *exa,
                struct exa_pixmap_priv *pixmap,
                int x0, int y0, int x1, int y1)
{
   renderer_solid(exa->renderer,
                  x0, y0, x1, y1, exa->solid_color);
}
Example #3
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);
    }
}
Example #4
0
XA_EXPORT void
xa_solid(struct xa_context *ctx, int x, int y, int width, int height)
{
    renderer_solid(ctx, x, y, x + width, y + height, ctx->solid_color);
}