mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 23:00:08 +00:00
gpu: Use GskGpuShaderImage for blendmode ops
This commit is contained in:
parent
23081d2bc4
commit
21988ea700
@ -52,17 +52,15 @@ static const GskGpuShaderOpClass GSK_GPU_BLEND_MODE_OP_CLASS = {
|
||||
};
|
||||
|
||||
void
|
||||
gsk_gpu_blend_mode_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuDescriptors *desc,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_point_t *offset,
|
||||
float opacity,
|
||||
GskBlendMode blend_mode,
|
||||
guint32 bottom_descriptor,
|
||||
const graphene_rect_t *bottom_rect,
|
||||
guint32 top_descriptor,
|
||||
const graphene_rect_t *top_rect)
|
||||
gsk_gpu_blend_mode_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuDescriptors *desc,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_point_t *offset,
|
||||
float opacity,
|
||||
GskBlendMode blend_mode,
|
||||
const GskGpuShaderImage *bottom,
|
||||
const GskGpuShaderImage *top)
|
||||
{
|
||||
GskGpuBlendmodeInstance *instance;
|
||||
|
||||
@ -76,8 +74,8 @@ gsk_gpu_blend_mode_op (GskGpuFrame *frame,
|
||||
|
||||
gsk_gpu_rect_to_float (rect, offset, instance->rect);
|
||||
instance->opacity = opacity;
|
||||
gsk_gpu_rect_to_float (bottom_rect, offset, instance->bottom_rect);
|
||||
instance->bottom_id = bottom_descriptor;
|
||||
gsk_gpu_rect_to_float (top_rect, offset, instance->top_rect);
|
||||
instance->top_id = top_descriptor;
|
||||
gsk_gpu_rect_to_float (bottom->bounds, offset, instance->bottom_rect);
|
||||
instance->bottom_id = bottom->descriptor;
|
||||
gsk_gpu_rect_to_float (top->bounds, offset, instance->top_rect);
|
||||
instance->top_id = top->descriptor;
|
||||
}
|
||||
|
@ -13,10 +13,8 @@ void gsk_gpu_blend_mode_op (GskGpuF
|
||||
const graphene_point_t *offset,
|
||||
float opacity,
|
||||
GskBlendMode blend_mode,
|
||||
guint32 start_descriptor,
|
||||
const graphene_rect_t *start_rect,
|
||||
guint32 end_descriptor,
|
||||
const graphene_rect_t *end_rect);
|
||||
const GskGpuShaderImage *bottom,
|
||||
const GskGpuShaderImage *top);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -2625,10 +2625,20 @@ gsk_gpu_node_processor_add_blend_node (GskGpuNodeProcessor *self,
|
||||
&self->offset,
|
||||
self->opacity,
|
||||
gsk_blend_node_get_blend_mode (node),
|
||||
descriptors[0],
|
||||
&bottom_rect,
|
||||
descriptors[1],
|
||||
&top_rect);
|
||||
&(GskGpuShaderImage) {
|
||||
bottom_image,
|
||||
GSK_GPU_SAMPLER_DEFAULT,
|
||||
descriptors[0],
|
||||
NULL,
|
||||
&bottom_rect
|
||||
},
|
||||
&(GskGpuShaderImage) {
|
||||
top_image,
|
||||
GSK_GPU_SAMPLER_DEFAULT,
|
||||
descriptors[1],
|
||||
NULL,
|
||||
&top_rect
|
||||
});
|
||||
|
||||
g_object_unref (top_image);
|
||||
g_object_unref (bottom_image);
|
||||
|
Loading…
Reference in New Issue
Block a user