[gtk/wip/chergert/glproto] extract out of jump table
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] extract out of jump table
- Date: Wed, 30 Dec 2020 19:18:42 +0000 (UTC)
commit db625915b69e16f802319bf3cafc69791d51876e
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 30 11:18:36 2020 -0800
extract out of jump table
gsk/next/gskglrenderjob.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 49a7f631d5..c606b17654 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -491,16 +491,29 @@ gsk_gl_render_job_draw_rect (GskGLRenderJob *job,
vertices[5].uv[1] = 0;
}
+static void
+gsk_gl_render_job_visit_color_node (GskGLRenderJob *job,
+ GskRenderNode *node)
+{
+ GskGLRenderModelview *modelview = gsk_gl_render_job_get_modelview (job);
+
+ gsk_gl_program_begin_draw (job->driver->color,
+ &job->viewport,
+ &job->projection,
+ &modelview->matrix,
+ gsk_gl_render_job_get_clip (job));
+ 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);
+}
+
static void
gsk_gl_render_job_visit_linear_gradient_node (GskGLRenderJob *job,
GskRenderNode *node)
{
- int n_color_stops;
-
- g_assert (job != NULL);
- g_assert (node != NULL);
-
- n_color_stops = gsk_linear_gradient_node_get_n_color_stops (node);
+ int n_color_stops = gsk_linear_gradient_node_get_n_color_stops (node);
if (n_color_stops < MAX_GRADIENT_STOPS)
{
@@ -540,8 +553,6 @@ static void
gsk_gl_render_job_visit_node (GskGLRenderJob *job,
GskRenderNode *node)
{
- GskGLRenderModelview *modelview;
-
g_assert (job != NULL);
g_assert (node != NULL);
g_assert (GSK_IS_NEXT_DRIVER (job->driver));
@@ -551,8 +562,6 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
!gsk_gl_render_job_node_overlaps_clip (job, node))
return;
- modelview = gsk_gl_render_job_get_modelview (job);
-
switch (gsk_render_node_get_node_type (node))
{
case GSK_CONTAINER_NODE:
@@ -585,18 +594,7 @@ gsk_gl_render_job_visit_node (GskGLRenderJob *job,
break;
case GSK_COLOR_NODE:
- {
- gsk_gl_program_begin_draw (job->driver->color,
- &job->viewport,
- &job->projection,
- &modelview->matrix,
- gsk_gl_render_job_get_clip (job));
- 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);
- }
+ gsk_gl_render_job_visit_color_node (job, node);
break;
case GSK_LINEAR_GRADIENT_NODE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]