[gtk/wip/chergert/glproto: 77/94] setup clip for color node




commit e2209b7e60c0701dbeebe46aabcf085ade3c7423
Author: Christian Hergert <chergert redhat com>
Date:   Tue Dec 29 10:26:43 2020 -0800

    setup clip for color node
    
    we can make this more hygenic, but this at least gets it drawing

 gsk/next/gskglrenderjob.c | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index bac0df3cc9..5fc0a4c73b 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -536,17 +536,26 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
     break;
 
     case GSK_COLOR_NODE:
-      g_assert (modelview != NULL);
-
-      gsk_gl_program_begin_draw (job->driver->color,
-                                 &job->viewport,
-                                 &job->projection,
-                                 &modelview->matrix);
-      gsk_gl_program_set_uniform_color (job->driver->color,
-                                        UNIFORM_COLOR_COLOR,
-                                        gsk_color_node_get_color (node));
-      gsk_gl_render_job_draw_rect (job, &node->bounds);
-      gsk_gl_program_end_draw (job->driver->color);
+      {
+        GskGLRenderClip *clip = gsk_gl_render_job_get_clip (job);
+
+        g_assert (modelview != NULL);
+        g_assert (g_str_equal (gsk_gl_program_get_name (job->driver->color), "color"));
+
+        gsk_gl_program_begin_draw (job->driver->color,
+                                   &job->viewport,
+                                   &job->projection,
+                                   &modelview->matrix);
+        if (clip != NULL)
+          gsk_gl_program_set_uniform_rounded_rect (job->driver->color,
+                                                   UNIFORM_SHARED_CLIP_RECT,
+                                                   &clip->rect);
+        gsk_gl_program_set_uniform_color (job->driver->color,
+                                          UNIFORM_COLOR_COLOR,
+                                          gsk_color_node_get_color (node));
+        gsk_gl_render_job_draw_rect (job, &node->bounds);
+        gsk_gl_program_end_draw (job->driver->color);
+      }
     break;
 
     case GSK_BLEND_NODE:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]