[gtk/wip/baedert/for-master: 13/23] gl renderer: Unify new clip/viewport rects in blur_texture()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 13/23] gl renderer: Unify new clip/viewport rects in blur_texture()
- Date: Mon, 21 Dec 2020 09:26:12 +0000 (UTC)
commit cde43541d0dbdd156b645f9dbe601bce3c3529ca
Author: Timm Bäder <mail baedert org>
Date: Fri Dec 18 16:14:11 2020 +0100
gl renderer: Unify new clip/viewport rects in blur_texture()
gsk/gl/gskglrenderer.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 0b7a45800c..7c11ee8698 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]