gpu: Use GskGpuShaderImage for crossfade ops

This commit is contained in:
Benjamin Otte
2024-07-19 12:11:40 +02:00
parent 71e412e8f8
commit 52db54e803
3 changed files with 30 additions and 24 deletions

View File

@@ -50,18 +50,16 @@ static const GskGpuShaderOpClass GSK_GPU_CROSS_FADE_OP_CLASS = {
};
void
gsk_gpu_cross_fade_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuColorStates color_states,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
float opacity,
float progress,
guint32 start_descriptor,
const graphene_rect_t *start_rect,
guint32 end_descriptor,
const graphene_rect_t *end_rect)
gsk_gpu_cross_fade_op (GskGpuFrame *frame,
GskGpuShaderClip clip,
GskGpuColorStates color_states,
GskGpuDescriptors *desc,
const graphene_rect_t *rect,
const graphene_point_t *offset,
float opacity,
float progress,
const GskGpuShaderImage *start,
const GskGpuShaderImage *end)
{
GskGpuCrossfadeInstance *instance;
@@ -76,8 +74,8 @@ gsk_gpu_cross_fade_op (GskGpuFrame *frame,
gsk_gpu_rect_to_float (rect, offset, instance->rect);
instance->opacity_progress[0] = opacity;
instance->opacity_progress[1] = progress;
gsk_gpu_rect_to_float (start_rect, offset, instance->start_rect);
instance->start_id = start_descriptor;
gsk_gpu_rect_to_float (end_rect, offset, instance->end_rect);
instance->end_id = end_descriptor;
gsk_gpu_rect_to_float (start->bounds, offset, instance->start_rect);
instance->start_id = start->descriptor;
gsk_gpu_rect_to_float (end->bounds, offset, instance->end_rect);
instance->end_id = end->descriptor;
}

View File

@@ -14,10 +14,8 @@ void gsk_gpu_cross_fade_op (GskGpuF
const graphene_point_t *offset,
float opacity,
float progress,
guint32 start_descriptor,
const graphene_rect_t *start_rect,
guint32 end_descriptor,
const graphene_rect_t *end_rect);
const GskGpuShaderImage *start,
const GskGpuShaderImage *end);
G_END_DECLS

View File

@@ -2739,10 +2739,20 @@ gsk_gpu_node_processor_add_cross_fade_node (GskGpuNodeProcessor *self,
&self->offset,
self->opacity,
progress,
descriptors[0],
&start_rect,
descriptors[1],
&end_rect);
&(GskGpuShaderImage) {
start_image,
GSK_GPU_SAMPLER_DEFAULT,
descriptors[0],
NULL,
&start_rect
},
&(GskGpuShaderImage) {
end_image,
GSK_GPU_SAMPLER_DEFAULT,
descriptors[1],
NULL,
&end_rect
});
g_object_unref (end_image);
g_object_unref (start_image);