gpu: Make blur op obey ccs
This commit is contained in:
@@ -54,21 +54,22 @@ static const GskGpuShaderOpClass GSK_GPU_BLUR_OP_CLASS = {
|
||||
|
||||
static void
|
||||
gsk_gpu_blur_op_full (GskGpuFrame *frame,
|
||||
guint32 variation,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuColorStates color_states,
|
||||
guint32 variation,
|
||||
GskGpuDescriptors *desc,
|
||||
guint32 descriptor,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *tex_rect,
|
||||
const graphene_vec2_t *blur_direction,
|
||||
const GdkRGBA *blur_color)
|
||||
float blur_color[4])
|
||||
{
|
||||
GskGpuBlurInstance *instance;
|
||||
|
||||
gsk_gpu_shader_op_alloc (frame,
|
||||
&GSK_GPU_BLUR_OP_CLASS,
|
||||
DEFAULT_COLOR_STATES,
|
||||
color_states,
|
||||
variation,
|
||||
clip,
|
||||
desc,
|
||||
@@ -77,13 +78,14 @@ gsk_gpu_blur_op_full (GskGpuFrame *frame,
|
||||
gsk_gpu_rect_to_float (rect, offset, instance->rect);
|
||||
gsk_gpu_rect_to_float (tex_rect, offset, instance->tex_rect);
|
||||
graphene_vec2_to_float (blur_direction, instance->blur_direction);
|
||||
gsk_gpu_rgba_to_float (blur_color, instance->blur_color);
|
||||
gsk_gpu_color_to_float (blur_color, instance->blur_color);
|
||||
instance->tex_id = descriptor;
|
||||
}
|
||||
|
||||
void
|
||||
gsk_gpu_blur_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuColorStates color_states,
|
||||
GskGpuDescriptors *desc,
|
||||
guint32 descriptor,
|
||||
const graphene_rect_t *rect,
|
||||
@@ -92,31 +94,34 @@ gsk_gpu_blur_op (GskGpuFrame *frame,
|
||||
const graphene_vec2_t *blur_direction)
|
||||
{
|
||||
gsk_gpu_blur_op_full (frame,
|
||||
0,
|
||||
clip,
|
||||
color_states,
|
||||
0,
|
||||
desc,
|
||||
descriptor,
|
||||
rect,
|
||||
offset,
|
||||
tex_rect,
|
||||
blur_direction,
|
||||
&GDK_RGBA_TRANSPARENT);
|
||||
(float[4]) { 1, 1, 1, 1 });
|
||||
}
|
||||
|
||||
void
|
||||
gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuColorStates color_states,
|
||||
GskGpuDescriptors *desc,
|
||||
guint32 descriptor,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *tex_rect,
|
||||
const graphene_vec2_t *blur_direction,
|
||||
const GdkRGBA *shadow_color)
|
||||
float shadow_color[4])
|
||||
{
|
||||
gsk_gpu_blur_op_full (frame,
|
||||
VARIATION_COLORIZE,
|
||||
clip,
|
||||
color_states,
|
||||
VARIATION_COLORIZE,
|
||||
desc,
|
||||
descriptor,
|
||||
rect,
|
||||
|
||||
@@ -8,6 +8,7 @@ G_BEGIN_DECLS
|
||||
|
||||
void gsk_gpu_blur_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuColorStates color_states,
|
||||
GskGpuDescriptors *desc,
|
||||
guint32 descriptor,
|
||||
const graphene_rect_t *rect,
|
||||
@@ -17,13 +18,14 @@ void gsk_gpu_blur_op (GskGpuF
|
||||
|
||||
void gsk_gpu_blur_shadow_op (GskGpuFrame *frame,
|
||||
GskGpuShaderClip clip,
|
||||
GskGpuColorStates color_states,
|
||||
GskGpuDescriptors *desc,
|
||||
guint32 descriptor,
|
||||
const graphene_rect_t *rect,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *tex_rect,
|
||||
const graphene_vec2_t *blur_direction,
|
||||
const GdkRGBA *shadow_color);
|
||||
float shadow_color[4]);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -811,6 +811,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
||||
graphene_vec2_init (&direction, blur_radius, 0.0f);
|
||||
gsk_gpu_blur_op (other.frame,
|
||||
gsk_gpu_clip_get_shader_clip (&other.clip, &other.offset, &intermediate_rect),
|
||||
gsk_gpu_node_processor_color_states_self (&other),
|
||||
source_desc,
|
||||
source_descriptor,
|
||||
&intermediate_rect,
|
||||
@@ -828,18 +829,20 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
|
||||
{
|
||||
gsk_gpu_blur_shadow_op (self->frame,
|
||||
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
||||
gsk_gpu_node_processor_color_states_for_rgba (self),
|
||||
self->desc,
|
||||
intermediate_descriptor,
|
||||
rect,
|
||||
&real_offset,
|
||||
&intermediate_rect,
|
||||
&direction,
|
||||
shadow_color);
|
||||
GSK_RGBA_TO_VEC4 (shadow_color));
|
||||
}
|
||||
else
|
||||
{
|
||||
gsk_gpu_blur_op (self->frame,
|
||||
gsk_gpu_clip_get_shader_clip (&self->clip, &real_offset, rect),
|
||||
gsk_gpu_node_processor_color_states_self (self),
|
||||
self->desc,
|
||||
intermediate_descriptor,
|
||||
rect,
|
||||
|
||||
@@ -31,7 +31,7 @@ run (out vec2 pos)
|
||||
|
||||
_pos = pos;
|
||||
_rect = r;
|
||||
_blur_color = in_blur_color;
|
||||
_blur_color = output_color_from_alt (in_blur_color);
|
||||
Rect tex_rect = rect_from_gsk (in_tex_rect);
|
||||
_tex_coord = rect_get_coord (tex_rect, pos);
|
||||
_tex_id = in_tex_id;
|
||||
|
||||
Reference in New Issue
Block a user