[gtk/wip/baedert/for-master: 5/13] GskRoundedRect: Inline graphene_rect_contains_rect
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 5/13] GskRoundedRect: Inline graphene_rect_contains_rect
- Date: Mon, 3 Feb 2020 11:08:57 +0000 (UTC)
commit c17406b38b112e37d911e590cb92ee806ac8022c
Author: Timm Bäder <mail baedert org>
Date: Fri Jan 31 17:08:17 2020 +0100
GskRoundedRect: Inline graphene_rect_contains_rect
Brings gsk_rounded_rect_contains_rect down from 0.54% to 0.14% when
rendering rounded backgrounds.
gsk/gskroundedrect.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gskroundedrect.c b/gsk/gskroundedrect.c
index 9a389b2eb7..bde6078b4e 100644
--- a/gsk/gskroundedrect.c
+++ b/gsk/gskroundedrect.c
@@ -338,7 +338,10 @@ gboolean
gsk_rounded_rect_contains_point (const GskRoundedRect *self,
const graphene_point_t *point)
{
- if (!graphene_rect_contains_point (&self->bounds, point))
+ if (point->x < self->bounds.origin.x ||
+ point->y < self->bounds.origin.y ||
+ point->x >= self->bounds.origin.x + self->bounds.size.width ||
+ point->y >= self->bounds.origin.y + self->bounds.size.height)
return FALSE;
if (self->bounds.origin.x + self->corner[GSK_CORNER_TOP_LEFT].width > point->x &&
@@ -395,7 +398,10 @@ gboolean
gsk_rounded_rect_contains_rect (const GskRoundedRect *self,
const graphene_rect_t *rect)
{
- if (!graphene_rect_contains_rect (&self->bounds, rect))
+ if (rect->origin.x < self->bounds.origin.x ||
+ rect->origin.y < self->bounds.origin.y ||
+ rect->origin.x + rect->size.width >= self->bounds.origin.x + self->bounds.size.width ||
+ rect->origin.y + rect->size.height >= self->bounds.origin.y + self->bounds.size.height)
return FALSE;
if (!gsk_rounded_rect_contains_point (self, &rect->origin) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]