gpu: Use GskGpuShaderImage for convert ops

This commit is contained in:
Benjamin Otte 2024-07-19 03:26:53 +02:00
parent 9644fc2e8f
commit 71e412e8f8
3 changed files with 26 additions and 22 deletions

View File

@ -54,16 +54,14 @@ static const GskGpuShaderOpClass GSK_GPU_CONVERT_OP_CLASS = {
};
void
gsk_gpu_convert_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuColorStates color_states,
float opacity,
GskGpuDescriptors *desc,
guint32 descriptor,
gboolean straight_alpha,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const graphene_rect_t *tex_rect)
gsk_gpu_convert_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuColorStates color_states,
float opacity,
GskGpuDescriptors *desc,
gboolean straight_alpha,
const graphene_point_t *offset,
const GskGpuShaderImage *image)
{
GskGpuConvertInstance *instance;
@ -76,9 +74,9 @@ gsk_gpu_convert_op (GskGpuFrame *frame,
desc,
&instance);
gsk_gpu_rect_to_float (rect, offset, instance->rect);
gsk_gpu_rect_to_float (tex_rect, offset, instance->tex_rect);
instance->tex_id = descriptor;
gsk_gpu_rect_to_float (image->coverage, offset, instance->rect);
gsk_gpu_rect_to_float (image->bounds, offset, instance->tex_rect);
instance->tex_id = image->descriptor;
instance->opacity = opacity;
}

View File

@ -11,11 +11,9 @@ void gsk_gpu_convert_op (GskGpuF
GskGpuColorStates color_states,
float opacity,
GskGpuDescriptors *desc,
guint32 descriptor,
gboolean straight_alpha,
const graphene_rect_t *rect,
const graphene_point_t *offset,
const graphene_rect_t *tex_rect);
const GskGpuShaderImage *image);
G_END_DECLS

View File

@ -548,11 +548,15 @@ gsk_gpu_node_processor_image_op (GskGpuNodeProcessor *self,
TRUE),
self->opacity,
self->desc,
descriptor,
straight_alpha,
rect,
&self->offset,
tex_rect);
&(GskGpuShaderImage) {
image,
sampler,
descriptor,
rect,
tex_rect
});
}
else
{
@ -4070,11 +4074,15 @@ gsk_gpu_node_processor_process (GskGpuFrame *frame,
gsk_gpu_node_processor_color_states_explicit (&self, ccs, TRUE),
self.opacity,
self.desc,
descriptor,
FALSE,
&node->bounds,
&self.offset,
&tex_rect);
&(GskGpuShaderImage) {
image,
GSK_GPU_SAMPLER_DEFAULT,
descriptor,
&node->bounds,
&tex_rect
});
gsk_gpu_render_pass_end_op (frame,
target,