[gtk/wip/chergert/glproto: 272/493] use inlined rect_contains_rect
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 272/493] use inlined rect_contains_rect
- Date: Fri, 19 Feb 2021 02:25:13 +0000 (UTC)
commit a435e9ac1927f08170b566a6ac1340f7b1785b63
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 27 20:16:45 2021 -0800
use inlined rect_contains_rect
like master does now.
gsk/next/gskglrenderjob.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/gsk/next/gskglrenderjob.c b/gsk/next/gskglrenderjob.c
index 65cf0b0409..4ebf4e1df3 100644
--- a/gsk/next/gskglrenderjob.c
+++ b/gsk/next/gskglrenderjob.c
@@ -253,6 +253,19 @@ color_matrix_modifies_alpha (GskRenderNode *node)
return !graphene_vec4_equal (graphene_vec4_w_axis (), &row3);
}
+static inline gboolean G_GNUC_PURE
+rect_contains_rect (const graphene_rect_t *r1,
+ const graphene_rect_t *r2)
+{
+ if (r2->origin.x >= r1->origin.x &&
+ (r2->origin.x + r2->size.width) <= (r1->origin.x + r1->size.width) &&
+ r2->origin.y >= r1->origin.y &&
+ (r2->origin.y + r2->size.height) <= (r1->origin.y + r1->size.height))
+ return TRUE;
+ else
+ return FALSE;
+}
+
static inline gboolean
rounded_inner_rect_contains_rect (const GskRoundedRect *rounded,
const graphene_rect_t *rect)
@@ -280,7 +293,7 @@ rounded_inner_rect_contains_rect (const GskRoundedRect *rounded,
MAX (rounded->corner[GSK_CORNER_BOTTOM_LEFT].height,
rounded->corner[GSK_CORNER_BOTTOM_RIGHT].height);
- return graphene_rect_contains_rect (&inner, rect);
+ return rect_contains_rect (&inner, rect);
}
static inline gboolean G_GNUC_PURE
@@ -298,19 +311,6 @@ rect_intersects (const graphene_rect_t *r1,
return TRUE;
}
-static inline gboolean G_GNUC_PURE
-rect_contains_rect (const graphene_rect_t *r1,
- const graphene_rect_t *r2)
-{
- if (r2->origin.x >= r1->origin.x &&
- (r2->origin.x + r2->size.width) <= (r1->origin.x + r1->size.width) &&
- r2->origin.y >= r1->origin.y &&
- (r2->origin.y + r2->size.height) <= (r1->origin.y + r1->size.height))
- return TRUE;
- else
- return FALSE;
-}
-
static inline gboolean
rounded_rect_has_corner (const GskRoundedRect *r,
guint i)
@@ -3154,7 +3154,7 @@ gsk_gl_render_job_visit_repeat_node (GskGLRenderJob *job,
/* If the size of the repeat node is smaller than the size of the
* child node, we don't repeat at all and can just draw that part
* of the child texture... */
- if (graphene_rect_contains_rect (child_bounds, &node->bounds))
+ if (rect_contains_rect (child_bounds, &node->bounds))
{
gsk_gl_render_job_visit_clipped_child (job, child, child_bounds);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]