[gtk/wip/baedert/for-master] 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] gl renderer: Unify new clip/viewport rects in blur_texture()
- Date: Fri, 18 Dec 2020 17:00:01 +0000 (UTC)
commit 32cf7903766bbf00676f5a87d99a3f6230c332bb
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 3cb261384c..92332f7c68 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1776,6 +1776,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;
@@ -1802,17 +1803,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;
@@ -1823,7 +1823,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
@@ -1845,7 +1845,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]