[gtk/wip/chergert/glproto: 411/493] remove getters for things accessible from job pointer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 411/493] remove getters for things accessible from job pointer
- Date: Fri, 19 Feb 2021 02:25:19 +0000 (UTC)
commit 421bfe5dd1de8dacf997f79a43e279d2564458c2
Author: Christian Hergert <chergert redhat com>
Date: Mon Feb 8 13:39:02 2021 -0800
remove getters for things accessible from job pointer
gsk/next/gskglrenderjob.c | 60 ++++++++++++-----------------------------------
1 file changed, 15 insertions(+), 45 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 9e1176b8bb..fb26550cc7 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -423,22 +423,6 @@ init_projection_matrix (graphene_matrix_t *projection,
graphene_matrix_scale (projection, 1, -1, 1);
}
-static inline const graphene_matrix_t *
-gsk_gl_render_job_get_modelview_matrix (GskGLRenderJob *job)
-{
- g_assert (job->modelview->len > 0);
-
- return &job->current_modelview->matrix;
-}
-
-static inline const GskGLRenderModelview *
-gsk_gl_render_job_get_modelview (GskGLRenderJob *job)
-{
- g_assert (job->modelview->len > 0);
-
- return job->current_modelview;
-}
-
static void
extract_matrix_metadata (GskGLRenderModelview *modelview)
{
@@ -588,7 +572,7 @@ gsk_gl_render_job_pop_modelview (GskGLRenderJob *job)
job->driver->last_shared_state++;
- head = gsk_gl_render_job_get_modelview (job);
+ head = job->current_modelview;
job->offset_x = head->offset_x_before;
job->offset_y = head->offset_y_before;
@@ -626,14 +610,6 @@ gsk_gl_render_job_clip_is_rectilinear (GskGLRenderJob *job)
return job->current_clip->is_rectilinear;
}
-static inline const GskRoundedRect *
-gsk_gl_render_job_get_clip (GskGLRenderJob *job)
-{
- g_assert (job->clip->len > 0);
-
- return &job->current_clip->rect;
-}
-
static void
gsk_gl_render_job_push_clip (GskGLRenderJob *job,
const GskRoundedRect *rect)
@@ -763,13 +739,9 @@ static inline gboolean
gsk_gl_render_job_node_overlaps_clip (GskGLRenderJob *job,
const GskRenderNode *node)
{
- const GskRoundedRect *clip = gsk_gl_render_job_get_clip (job);
graphene_rect_t transformed_bounds;
-
- g_assert (clip != NULL);
-
gsk_gl_render_job_transform_bounds (job, &node->bounds, &transformed_bounds);
- return rect_intersects (&clip->bounds, &transformed_bounds);
+ return rect_intersects (&job->current_clip->rect.bounds, &transformed_bounds);
}
/* load_vertex_data_with_region */
@@ -1335,11 +1307,9 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
if (gsk_gl_render_job_clip_is_rectilinear (job))
{
- const GskRoundedRect *current_clip = gsk_gl_render_job_get_clip (job);
-
memset (&intersection.corner, 0, sizeof intersection.corner);
graphene_rect_intersection (&transformed_clip,
- ¤t_clip->bounds,
+ &job->current_clip->rect.bounds,
&intersection.bounds);
gsk_gl_render_job_push_clip (job, &intersection);
@@ -1347,7 +1317,7 @@ gsk_gl_render_job_visit_clipped_child (GskGLRenderJob *job,
gsk_gl_render_job_pop_clip (job);
}
else if (intersect_rounded_rectilinear (&transformed_clip,
- gsk_gl_render_job_get_clip (job),
+ &job->current_clip->rect,
&intersection))
{
gsk_gl_render_job_push_clip (job, &intersection);
@@ -1409,7 +1379,7 @@ gsk_gl_render_job_visit_rounded_clip_node (GskGLRenderJob *job,
if (node_is_invisible (child))
return;
- current_clip = *gsk_gl_render_job_get_clip (job);
+ memcpy (¤t_clip, job->current_clip, sizeof current_clip);
gsk_gl_render_job_transform_bounds (job, &clip->bounds, &transformed_clip.bounds);
@@ -2975,8 +2945,8 @@ gsk_gl_render_job_visit_gl_shader_node (GskGLRenderJob *job,
gsk_gl_program_begin_draw (program,
&job->viewport,
&job->projection,
- gsk_gl_render_job_get_modelview_matrix (job),
- gsk_gl_render_job_get_clip (job),
+ &job->current_modelview->matrix,
+ &job->current_clip->rect,
job->alpha);
for (guint i = 0; i < n_children; i++)
gsk_gl_program_set_uniform_texture (program,
@@ -3089,8 +3059,8 @@ gsk_gl_render_job_visit_texture_node (GskGLRenderJob *job,
gsk_gl_program_begin_draw (job->driver->blit,
&job->viewport,
&job->projection,
- gsk_gl_render_job_get_modelview_matrix (job),
- gsk_gl_render_job_get_clip (job),
+ &job->current_modelview->matrix,
+ &job->current_clip->rect,
job->alpha);
gsk_gl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE,
@@ -3119,8 +3089,8 @@ gsk_gl_render_job_visit_texture_node (GskGLRenderJob *job,
gsk_gl_program_begin_draw (job->driver->blit,
&job->viewport,
&job->projection,
- gsk_gl_render_job_get_modelview_matrix (job),
- gsk_gl_render_job_get_clip (job),
+ &job->current_modelview->matrix,
+ &job->current_clip->rect,
job->alpha);
for (guint i = 0; i < n_slices; i ++)
@@ -3214,8 +3184,8 @@ gsk_gl_render_job_visit_repeat_node (GskGLRenderJob *job,
gsk_gl_program_begin_draw (job->driver->repeat,
&job->viewport,
&job->projection,
- gsk_gl_render_job_get_modelview_matrix (job),
- gsk_gl_render_job_get_clip (job),
+ &job->current_modelview->matrix,
+ &job->current_clip->rect,
job->alpha);
gsk_gl_program_set_uniform_texture (job->driver->repeat,
UNIFORM_SHARED_SOURCE,
@@ -3598,8 +3568,8 @@ gsk_gl_render_job_render_flipped (GskGLRenderJob *job,
gsk_gl_program_begin_draw (job->driver->blit,
&job->viewport,
&proj,
- gsk_gl_render_job_get_modelview_matrix (job),
- gsk_gl_render_job_get_clip (job),
+ &job->current_modelview->matrix,
+ &job->current_clip->rect,
1.0);
gsk_gl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]