[gtk/wip/chergert/glproto] color matrix node
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] color matrix node
- Date: Tue, 12 Jan 2021 04:22:14 +0000 (UTC)
commit 4c944d727a35ccb564914d7a0df83398806847b7
Author: Christian Hergert <chergert redhat com>
Date: Mon Jan 11 20:22:07 2021 -0800
color matrix node
gsk/next/gskglrenderjob.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 88356a50f4..1e57ae323b 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -1788,7 +1788,35 @@ static void
gsk_gl_render_job_visit_color_matrix_node (GskGLRenderJob *job,
GskRenderNode *node)
{
- gsk_gl_render_job_visit_as_fallback (job, node);
+ GskRenderNode *child = gsk_color_matrix_node_get_child (node);
+ GskGLRenderOffscreen offscreen = {0};
+ float offset[4];
+
+ if (node_is_invisible (child))
+ return;
+
+ offscreen.bounds = &node->bounds;
+ offscreen.reset_clip = TRUE;
+
+ if (!gsk_gl_render_job_visit_node_with_offscreen (job, child, &offscreen))
+ g_assert_not_reached ();
+
+ graphene_vec4_to_float (gsk_color_matrix_node_get_color_offset (node), offset);
+
+ gsk_gl_program_begin_draw (job->driver->color_matrix,
+ &job->viewport,
+ &job->projection,
+ gsk_gl_render_job_get_modelview_matrix (job),
+ gsk_gl_render_job_get_clip (job),
+ job->alpha);
+ gsk_gl_program_set_uniform_matrix (job->driver->color_matrix,
+ UNIFORM_COLOR_MATRIX_COLOR_MATRIX,
+ gsk_color_matrix_node_get_color_matrix (node));
+ gsk_gl_program_set_uniform4fv (job->driver->color_matrix,
+ UNIFORM_COLOR_MATRIX_COLOR_OFFSET,
+ 1,
+ offset);
+ gsk_gl_program_end_draw (job->driver->color_matrix);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]