gpu: Use GskGpuShaderImage for blur ops
This commit is contained in:
@@ -53,17 +53,15 @@ static const GskGpuShaderOpClass GSK_GPU_BLUR_OP_CLASS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gpu_blur_op_full (GskGpuFrame *frame,
|
gsk_gpu_blur_op_full (GskGpuFrame *frame,
|
||||||
GskGpuShaderClip clip,
|
GskGpuShaderClip clip,
|
||||||
GskGpuColorStates color_states,
|
GskGpuColorStates color_states,
|
||||||
guint32 variation,
|
guint32 variation,
|
||||||
GskGpuDescriptors *desc,
|
GskGpuDescriptors *desc,
|
||||||
guint32 descriptor,
|
const graphene_point_t *offset,
|
||||||
const graphene_rect_t *rect,
|
const GskGpuShaderImage *image,
|
||||||
const graphene_point_t *offset,
|
const graphene_vec2_t *blur_direction,
|
||||||
const graphene_rect_t *tex_rect,
|
float blur_color[4])
|
||||||
const graphene_vec2_t *blur_direction,
|
|
||||||
float blur_color[4])
|
|
||||||
{
|
{
|
||||||
GskGpuBlurInstance *instance;
|
GskGpuBlurInstance *instance;
|
||||||
|
|
||||||
@@ -75,58 +73,50 @@ gsk_gpu_blur_op_full (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);
|
||||||
graphene_vec2_to_float (blur_direction, instance->blur_direction);
|
graphene_vec2_to_float (blur_direction, instance->blur_direction);
|
||||||
gsk_gpu_color_to_float (blur_color, instance->blur_color);
|
gsk_gpu_color_to_float (blur_color, instance->blur_color);
|
||||||
instance->tex_id = descriptor;
|
instance->tex_id = image->descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gsk_gpu_blur_op (GskGpuFrame *frame,
|
gsk_gpu_blur_op (GskGpuFrame *frame,
|
||||||
GskGpuShaderClip clip,
|
GskGpuShaderClip clip,
|
||||||
GskGpuColorStates color_states,
|
GskGpuColorStates color_states,
|
||||||
GskGpuDescriptors *desc,
|
GskGpuDescriptors *desc,
|
||||||
guint32 descriptor,
|
const graphene_point_t *offset,
|
||||||
const graphene_rect_t *rect,
|
const GskGpuShaderImage *image,
|
||||||
const graphene_point_t *offset,
|
const graphene_vec2_t *blur_direction)
|
||||||
const graphene_rect_t *tex_rect,
|
|
||||||
const graphene_vec2_t *blur_direction)
|
|
||||||
{
|
{
|
||||||
gsk_gpu_blur_op_full (frame,
|
gsk_gpu_blur_op_full (frame,
|
||||||
clip,
|
clip,
|
||||||
color_states,
|
color_states,
|
||||||
0,
|
0,
|
||||||
desc,
|
desc,
|
||||||
descriptor,
|
|
||||||
rect,
|
|
||||||
offset,
|
offset,
|
||||||
tex_rect,
|
image,
|
||||||
blur_direction,
|
blur_direction,
|
||||||
(float[4]) { 1, 1, 1, 1 });
|
(float[4]) { 1, 1, 1, 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
||||||
GskGpuShaderClip clip,
|
GskGpuShaderClip clip,
|
||||||
GskGpuColorStates color_states,
|
GskGpuColorStates color_states,
|
||||||
GskGpuDescriptors *desc,
|
GskGpuDescriptors *desc,
|
||||||
guint32 descriptor,
|
const graphene_point_t *offset,
|
||||||
const graphene_rect_t *rect,
|
const GskGpuShaderImage *image,
|
||||||
const graphene_point_t *offset,
|
const graphene_vec2_t *blur_direction,
|
||||||
const graphene_rect_t *tex_rect,
|
float shadow_color[4])
|
||||||
const graphene_vec2_t *blur_direction,
|
|
||||||
float shadow_color[4])
|
|
||||||
{
|
{
|
||||||
gsk_gpu_blur_op_full (frame,
|
gsk_gpu_blur_op_full (frame,
|
||||||
clip,
|
clip,
|
||||||
color_states,
|
color_states,
|
||||||
VARIATION_COLORIZE,
|
VARIATION_COLORIZE,
|
||||||
desc,
|
desc,
|
||||||
descriptor,
|
|
||||||
rect,
|
|
||||||
offset,
|
offset,
|
||||||
tex_rect,
|
image,
|
||||||
blur_direction,
|
blur_direction,
|
||||||
shadow_color);
|
shadow_color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,20 +10,16 @@ void gsk_gpu_blur_op (GskGpuF
|
|||||||
GskGpuShaderClip clip,
|
GskGpuShaderClip clip,
|
||||||
GskGpuColorStates color_states,
|
GskGpuColorStates color_states,
|
||||||
GskGpuDescriptors *desc,
|
GskGpuDescriptors *desc,
|
||||||
guint32 descriptor,
|
|
||||||
const graphene_rect_t *rect,
|
|
||||||
const graphene_point_t *offset,
|
const graphene_point_t *offset,
|
||||||
const graphene_rect_t *tex_rect,
|
const GskGpuShaderImage *image,
|
||||||
const graphene_vec2_t *blur_direction);
|
const graphene_vec2_t *blur_direction);
|
||||||
|
|
||||||
void gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
void gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
||||||
GskGpuShaderClip clip,
|
GskGpuShaderClip clip,
|
||||||
GskGpuColorStates color_states,
|
GskGpuColorStates color_states,
|
||||||
GskGpuDescriptors *desc,
|
GskGpuDescriptors *desc,
|
||||||
guint32 descriptor,
|
|
||||||
const graphene_rect_t *rect,
|
|
||||||
const graphene_point_t *offset,
|
const graphene_point_t *offset,
|
||||||
const graphene_rect_t *tex_rect,
|
const GskGpuShaderImage *image,
|
||||||
const graphene_vec2_t *blur_direction,
|
const graphene_vec2_t *blur_direction,
|
||||||
float shadow_color[4]);
|
float shadow_color[4]);
|
||||||
|
|
||||||
|
|||||||
@@ -766,6 +766,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
|||||||
float blur_radius,
|
float blur_radius,
|
||||||
const GdkRGBA *shadow_color,
|
const GdkRGBA *shadow_color,
|
||||||
GskGpuDescriptors *source_desc,
|
GskGpuDescriptors *source_desc,
|
||||||
|
GskGpuImage *source_image,
|
||||||
guint32 source_descriptor,
|
guint32 source_descriptor,
|
||||||
GdkMemoryDepth source_depth,
|
GdkMemoryDepth source_depth,
|
||||||
const graphene_rect_t *source_rect)
|
const graphene_rect_t *source_rect)
|
||||||
@@ -804,10 +805,14 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
|||||||
gsk_gpu_clip_get_shader_clip (&other.clip, &other.offset, &intermediate_rect),
|
gsk_gpu_clip_get_shader_clip (&other.clip, &other.offset, &intermediate_rect),
|
||||||
gsk_gpu_node_processor_color_states_self (&other),
|
gsk_gpu_node_processor_color_states_self (&other),
|
||||||
source_desc,
|
source_desc,
|
||||||
source_descriptor,
|
|
||||||
&intermediate_rect,
|
|
||||||
&other.offset,
|
&other.offset,
|
||||||
source_rect,
|
&(GskGpuShaderImage) {
|
||||||
|
source_image,
|
||||||
|
GSK_GPU_SAMPLER_TRANSPARENT,
|
||||||
|
source_descriptor,
|
||||||
|
&intermediate_rect,
|
||||||
|
source_rect
|
||||||
|
},
|
||||||
&direction);
|
&direction);
|
||||||
|
|
||||||
gsk_gpu_node_processor_finish_draw (&other, intermediate);
|
gsk_gpu_node_processor_finish_draw (&other, intermediate);
|
||||||
@@ -822,10 +827,14 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
|||||||
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
||||||
gsk_gpu_node_processor_color_states_for_rgba (self),
|
gsk_gpu_node_processor_color_states_for_rgba (self),
|
||||||
self->desc,
|
self->desc,
|
||||||
intermediate_descriptor,
|
|
||||||
rect,
|
|
||||||
&real_offset,
|
&real_offset,
|
||||||
&intermediate_rect,
|
&(GskGpuShaderImage) {
|
||||||
|
intermediate,
|
||||||
|
GSK_GPU_SAMPLER_TRANSPARENT,
|
||||||
|
intermediate_descriptor,
|
||||||
|
rect,
|
||||||
|
&intermediate_rect,
|
||||||
|
},
|
||||||
&direction,
|
&direction,
|
||||||
GSK_RGBA_TO_VEC4 (shadow_color));
|
GSK_RGBA_TO_VEC4 (shadow_color));
|
||||||
}
|
}
|
||||||
@@ -835,10 +844,14 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
|||||||
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
||||||
gsk_gpu_node_processor_color_states_self (self),
|
gsk_gpu_node_processor_color_states_self (self),
|
||||||
self->desc,
|
self->desc,
|
||||||
intermediate_descriptor,
|
|
||||||
rect,
|
|
||||||
&real_offset,
|
&real_offset,
|
||||||
&intermediate_rect,
|
&(GskGpuShaderImage) {
|
||||||
|
intermediate,
|
||||||
|
GSK_GPU_SAMPLER_TRANSPARENT,
|
||||||
|
intermediate_descriptor,
|
||||||
|
rect,
|
||||||
|
&intermediate_rect,
|
||||||
|
},
|
||||||
&direction);
|
&direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2483,6 +2496,7 @@ gsk_gpu_node_processor_add_blur_node (GskGpuNodeProcessor *self,
|
|||||||
blur_radius,
|
blur_radius,
|
||||||
NULL,
|
NULL,
|
||||||
self->desc,
|
self->desc,
|
||||||
|
image,
|
||||||
descriptor,
|
descriptor,
|
||||||
gdk_memory_format_get_depth (gsk_gpu_image_get_format (image),
|
gdk_memory_format_get_depth (gsk_gpu_image_get_format (image),
|
||||||
gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_SRGB),
|
gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_SRGB),
|
||||||
@@ -2553,6 +2567,7 @@ gsk_gpu_node_processor_add_shadow_node (GskGpuNodeProcessor *self,
|
|||||||
shadow->radius,
|
shadow->radius,
|
||||||
&shadow->color,
|
&shadow->color,
|
||||||
desc,
|
desc,
|
||||||
|
image,
|
||||||
descriptor,
|
descriptor,
|
||||||
gdk_memory_format_get_depth (gsk_gpu_image_get_format (image),
|
gdk_memory_format_get_depth (gsk_gpu_image_get_format (image),
|
||||||
gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_SRGB),
|
gsk_gpu_image_get_flags (image) & GSK_GPU_IMAGE_SRGB),
|
||||||
|
|||||||
Reference in New Issue
Block a user