[gtk+/wip/baedert/gl: 25/25] gl renderer: Avoid some code duplication
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gl: 25/25] gl renderer: Avoid some code duplication
- Date: Sun, 31 Dec 2017 14:26:56 +0000 (UTC)
commit fa035e3538a66c9cf2589646ad9d0fa19ba5a524
Author: Timm Bäder <mail baedert org>
Date: Sun Dec 31 08:45:40 2017 +0100
gl renderer: Avoid some code duplication
gsk/gl/gskglrenderer.c | 38 +++++++++++++-------------------------
1 files changed, 13 insertions(+), 25 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 6025c88..191fa89 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1000,42 +1000,30 @@ render_outset_shadow_node (GskGLRenderer *self,
if (blur_radius > 0)
{
ops_set_program (builder, &self->blur_program);
- ops_set_clip (builder, &blit_clip);
- ops_set_texture (builder, texture_id);
op.op = OP_CHANGE_BLUR;
- op.blur.dir[0] = 1;
- op.blur.dir[1] = 0;
op.blur.size.width = texture_width;
op.blur.size.height = texture_height;
op.blur.radius = blur_radius;
ops_add (builder, &op);
-
- ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) {
- { { 0, 0 }, { 0, 1 }, },
- { { 0, texture_height }, { 0, 0 }, },
- { { texture_width, 0 }, { 1, 1 }, },
-
- { { texture_width, texture_height }, { 1, 0 }, },
- { { 0, texture_height }, { 0, 0 }, },
- { { texture_width, 0 }, { 1, 1 }, },
- });
}
else
{
ops_set_program (builder, &self->blit_program);
- ops_set_clip (builder, &blit_clip);
- ops_set_texture (builder, texture_id);
- ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) {
- { { 0, 0 }, { 0, 1 }, },
- { { 0, texture_height }, { 0, 0 }, },
- { { texture_width, 0 }, { 1, 1 }, },
-
- { { texture_width, texture_height }, { 1, 0 }, },
- { { 0, texture_height }, { 0, 0 }, },
- { { texture_width, 0 }, { 1, 1 }, },
- });
}
+ ops_set_clip (builder, &blit_clip);
+ ops_set_texture (builder, texture_id);
+ ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) {
+ { { 0, 0 }, { 0, 1 }, },
+ { { 0, texture_height }, { 0, 0 }, },
+ { { texture_width, 0 }, { 1, 1 }, },
+
+ { { texture_width, texture_height }, { 1, 0 }, },
+ { { 0, texture_height }, { 0, 0 }, },
+ { { texture_width, 0 }, { 1, 1 }, },
+ });
+
+
ops_set_clip (builder, &prev_clip);
ops_set_viewport (builder, &prev_viewport);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]