gl renderer: Unify new clip/viewport rects in blur_texture()
This commit is contained in:
@@ -1824,6 +1824,7 @@ blur_texture (GskGLRenderer *self,
|
||||
float blur_radius_x,
|
||||
float blur_radius_y)
|
||||
{
|
||||
const GskRoundedRect new_clip = GSK_ROUNDED_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height);
|
||||
int pass1_texture_id, pass1_render_target;
|
||||
int pass2_texture_id, pass2_render_target;
|
||||
int prev_render_target;
|
||||
@@ -1850,17 +1851,16 @@ blur_texture (GskGLRenderer *self,
|
||||
GL_NEAREST, GL_NEAREST,
|
||||
&pass2_texture_id, &pass2_render_target);
|
||||
|
||||
init_projection_matrix (&item_proj,
|
||||
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
|
||||
init_projection_matrix (&item_proj, &new_clip.bounds);
|
||||
|
||||
ops_set_program (builder, &self->programs->blur_program);
|
||||
prev_projection = ops_set_projection (builder, &item_proj);
|
||||
ops_set_modelview (builder, NULL);
|
||||
prev_viewport = ops_set_viewport (builder, &GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
|
||||
ops_push_clip (builder, &GSK_ROUNDED_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height));
|
||||
prev_viewport = ops_set_viewport (builder, &new_clip.bounds);
|
||||
ops_push_clip (builder, &new_clip);
|
||||
|
||||
prev_render_target = ops_set_render_target (builder, pass1_render_target);
|
||||
ops_begin (builder, OP_CLEAR);
|
||||
ops_set_program (builder, &self->programs->blur_program);
|
||||
|
||||
op = ops_begin (builder, OP_CHANGE_BLUR);
|
||||
op->size.width = texture_to_blur_width;
|
||||
@@ -1871,7 +1871,7 @@ blur_texture (GskGLRenderer *self,
|
||||
ops_set_texture (builder, region->texture_id);
|
||||
|
||||
load_vertex_data_with_region (ops_draw (builder, NULL),
|
||||
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height),
|
||||
&new_clip.bounds,
|
||||
builder, region,
|
||||
FALSE);
|
||||
#if 0
|
||||
@@ -1893,7 +1893,7 @@ blur_texture (GskGLRenderer *self,
|
||||
ops_set_render_target (builder, pass2_render_target);
|
||||
ops_begin (builder, OP_CLEAR);
|
||||
load_vertex_data_with_region (ops_draw (builder, NULL), /* render pass 2 */
|
||||
&GRAPHENE_RECT_INIT (0, 0, texture_to_blur_width, texture_to_blur_height),
|
||||
&new_clip.bounds,
|
||||
builder, region,
|
||||
FALSE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user