Lines Matching refs:ctx
253 bind_composite_blend_state(struct xa_context *ctx,
271 cso_set_blend(ctx->cso, &blend);
336 * \param ctx[in, out]: Pointer to the xa context.
347 xa_handle_src_pict(struct xa_context *ctx,
365 if (is_mask && ctx->has_solid_src)
366 xa_src_in_mask(ctx->solid_color, solid_color);
368 memcpy(ctx->solid_color, solid_color, sizeof(solid_color));
371 ctx->has_solid_mask = TRUE;
373 ctx->has_solid_src = TRUE;
379 bind_shaders(struct xa_context *ctx, const struct xa_composite *comp)
387 ctx->has_solid_src = FALSE;
388 ctx->has_solid_mask = FALSE;
402 if (!xa_handle_src_pict(ctx, src_pic->src_pict, false))
416 if (!xa_handle_src_pict(ctx, mask_pic->src_pict, true))
419 if (ctx->has_solid_src) {
435 if (ctx->srf->format == PIPE_FORMAT_L8_UNORM ||
436 ctx->srf->format == PIPE_FORMAT_R8_UNORM)
439 shader = xa_shaders_get(ctx->shaders, vs_traits, fs_traits);
440 cso_set_vertex_shader_handle(ctx->cso, shader.vs);
441 cso_set_fragment_shader_handle(ctx->cso, shader.fs);
446 bind_samplers(struct xa_context *ctx,
453 struct pipe_context *pipe = ctx->pipe;
458 xa_ctx_sampler_views_destroy(ctx);
462 if (src_pic && !ctx->has_solid_src) {
479 ctx->bound_sampler_views[0] = src_view;
483 if (mask_pic && !ctx->has_solid_mask) {
501 ctx->bound_sampler_views[num_samplers] = src_view;
505 cso_set_samplers(ctx->cso, PIPE_SHADER_FRAGMENT, num_samplers,
508 false, ctx->bound_sampler_views);
509 ctx->num_bound_samplers = num_samplers;
513 xa_composite_prepare(struct xa_context *ctx,
519 ret = xa_ctx_srf_create(ctx, dst_srf);
523 ctx->dst = dst_srf;
524 renderer_bind_destination(ctx, ctx->srf);
526 ret = bind_composite_blend_state(ctx, comp);
529 ret = bind_shaders(ctx, comp);
532 bind_samplers(ctx, comp);
534 if (ctx->num_bound_samplers == 0 ) { /* solid fill */
535 renderer_begin_solid(ctx);
537 renderer_begin_textures(ctx);
538 ctx->comp = comp;
541 xa_ctx_srf_destroy(ctx);
546 xa_composite_rect(struct xa_context *ctx,
550 if (ctx->num_bound_samplers == 0 ) { /* solid fill */
551 xa_scissor_update(ctx, dstX, dstY, dstX + width, dstY + height);
552 renderer_solid(ctx, dstX, dstY, dstX + width, dstY + height);
554 const struct xa_composite *comp = ctx->comp;
559 xa_scissor_update(ctx, dstX, dstY, dstX + width, dstY + height);
566 renderer_texture(ctx, pos, width, height,
572 xa_composite_done(struct xa_context *ctx)
574 renderer_draw_flush(ctx);
576 ctx->comp = NULL;
577 ctx->has_solid_src = FALSE;
578 ctx->has_solid_mask = FALSE;
579 xa_ctx_sampler_views_destroy(ctx);