gpu: Make crossfade op obey ccs

I didn't have an idea what to use the alternate color state for, so I
don't use it.
This commit is contained in:
Benjamin Otte
2024-07-05 02:31:38 +02:00
parent fa33af248e
commit c0aba9aee1
4 changed files with 12 additions and 7 deletions

View File

@@ -52,6 +52,7 @@ 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,
@@ -66,7 +67,7 @@ gsk_gpu_cross_fade_op (GskGpuFrame *frame,
gsk_gpu_shader_op_alloc (frame,
&GSK_GPU_CROSS_FADE_OP_CLASS,
DEFAULT_COLOR_STATES,
color_states,
0,
clip,
desc,

View File

@@ -8,6 +8,7 @@ G_BEGIN_DECLS
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,

View File

@@ -2511,6 +2511,7 @@ gsk_gpu_node_processor_add_cross_fade_node (GskGpuNodeProcessor *self,
gsk_gpu_cross_fade_op (self->frame,
gsk_gpu_clip_get_shader_clip (&self->clip, &self->offset, &node->bounds),
gsk_gpu_node_processor_color_states_for_rgba (self),
self->desc,
&node->bounds,
&self->offset,

View File

@@ -52,12 +52,14 @@ void
run (out vec4 color,
out vec2 position)
{
color = gsk_texture (_start_id, _start_coord) *
rect_coverage (_start_rect, _pos) *
_start_opacity +
gsk_texture (_end_id, _end_coord) *
rect_coverage (_end_rect, _pos) *
_end_opacity;
vec4 start = output_color_alpha (gsk_texture (_start_id, _start_coord),
rect_coverage (_start_rect, _pos) *
_start_opacity);
vec4 end = output_color_alpha (gsk_texture (_end_id, _end_coord),
rect_coverage (_end_rect, _pos) *
_end_opacity);
color = start + end;
position = _pos;
}