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

@ -59,11 +59,9 @@ gsk_gpu_convert_op (GskGpuFrame *frame,
GskGpuColorStates color_states, GskGpuColorStates color_states,
float opacity, float opacity,
GskGpuDescriptors *desc, GskGpuDescriptors *desc,
guint32 descriptor,
gboolean straight_alpha, gboolean straight_alpha,
const graphene_rect_t *rect,
const graphene_point_t *offset, const graphene_point_t *offset,
const graphene_rect_t *tex_rect) const GskGpuShaderImage *image)
{ {
GskGpuConvertInstance *instance; GskGpuConvertInstance *instance;
@ -76,9 +74,9 @@ gsk_gpu_convert_op (GskGpuFrame *frame,
desc, desc,
&instance); &instance);
gsk_gpu_rect_to_float (rect, offset, instance->rect); gsk_gpu_rect_to_float (image->coverage, offset, instance->rect);
gsk_gpu_rect_to_float (tex_rect, offset, instance->tex_rect); gsk_gpu_rect_to_float (image->bounds, offset, instance->tex_rect);
instance->tex_id = descriptor; instance->tex_id = image->descriptor;
instance->opacity = opacity; instance->opacity = opacity;
} }

View File

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

View File

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