[gtk/wip/chergert/glproto: 218/493] add texture and vertices for color matrix




commit dfce80748e454fedac6f9f11d2cca4f06eb1adbf
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 20 12:43:41 2021 -0800

    add texture and vertices for color matrix

 gsk/next/gskglrenderjob.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 76c92ffaaa..aee61406d8 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -2837,6 +2837,8 @@ gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
   if (!gsk_gl_render_job_visit_node_with_offscreen (job, child, &offscreen))
     g_assert_not_reached ();
 
+  g_assert (offscreen.texture_id > 0);
+
   graphene_vec4_to_float (gsk_color_matrix_node_get_color_offset (node), offset);
 
   gsk_gl_program_begin_draw (job->driver->color_matrix,
@@ -2845,6 +2847,11 @@ gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
                              gsk_gl_render_job_get_modelview_matrix (job),
                              gsk_gl_render_job_get_clip (job),
                              job->alpha);
+  gsk_gl_program_set_uniform_texture (job->driver->color_matrix,
+                                      UNIFORM_SHARED_SOURCE,
+                                      GL_TEXTURE_2D,
+                                      GL_TEXTURE0,
+                                      offscreen.texture_id);
   gsk_gl_program_set_uniform_matrix (job->driver->color_matrix,
                                      UNIFORM_COLOR_MATRIX_COLOR_MATRIX,
                                      gsk_color_matrix_node_get_color_matrix (node));
@@ -2852,6 +2859,7 @@ gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
                                  UNIFORM_COLOR_MATRIX_COLOR_OFFSET,
                                  1,
                                  offset);
+  gsk_gl_render_job_load_vertices_from_offscreen (job, &node->bounds, &offscreen);
   gsk_gl_program_end_draw (job->driver->color_matrix);
 }
 


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