1
0
Fork 0

cogl/clip-stack: Removing window rect

The only consumer of this type of rect was the scissor clipping,
which was removed by the previous commit.

Remove window rects from CoglClipStack, and all dependent code.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3006>
This commit is contained in:
Georges Basile Stavracas Neto 2023-05-16 18:57:42 -03:00 committed by Marge Bot
parent 656ccb4dee
commit 3b7ca42c6f
4 changed files with 1 additions and 58 deletions

View file

@ -127,27 +127,6 @@ _cogl_clip_stack_entry_set_bounds (CoglClipStack *entry,
entry->bounds_y1 = ceilf (max_y);
}
CoglClipStack *
_cogl_clip_stack_push_window_rectangle (CoglClipStack *stack,
int x_offset,
int y_offset,
int width,
int height)
{
CoglClipStack *entry;
entry = _cogl_clip_stack_push_entry (stack,
sizeof (CoglClipStackWindowRect),
COGL_CLIP_STACK_WINDOW_RECT);
entry->bounds_x0 = x_offset;
entry->bounds_x1 = x_offset + width;
entry->bounds_y0 = y_offset;
entry->bounds_y1 = y_offset + height;
return entry;
}
CoglClipStack *
_cogl_clip_stack_push_rectangle (CoglClipStack *stack,
float x_1,
@ -344,9 +323,6 @@ _cogl_clip_stack_unref (CoglClipStack *entry)
g_free (entry);
break;
}
case COGL_CLIP_STACK_WINDOW_RECT:
g_free (entry);
break;
case COGL_CLIP_STACK_PRIMITIVE:
{
CoglClipStackPrimitive *primitive_entry =

View file

@ -52,7 +52,6 @@ typedef struct _CoglClipStackRegion CoglClipStackRegion;
typedef enum
{
COGL_CLIP_STACK_RECT,
COGL_CLIP_STACK_WINDOW_RECT,
COGL_CLIP_STACK_PRIMITIVE,
COGL_CLIP_STACK_REGION,
} CoglClipStackType;
@ -140,14 +139,6 @@ struct _CoglClipStackRect
gboolean can_be_scissor;
};
struct _CoglClipStackWindowRect
{
CoglClipStack _parent_data;
/* The window rect clip doesn't need any specific data because it
just adds to the scissor clip */
};
struct _CoglClipStackPrimitive
{
CoglClipStack _parent_data;
@ -170,13 +161,6 @@ struct _CoglClipStackRegion
cairo_region_t *region;
};
CoglClipStack *
_cogl_clip_stack_push_window_rectangle (CoglClipStack *stack,
int x_offset,
int y_offset,
int width,
int height);
COGL_EXPORT CoglClipStack *
_cogl_clip_stack_push_rectangle (CoglClipStack *stack,
float x_1,

View file

@ -1733,7 +1733,6 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
float y,
gboolean *hit)
{
gboolean can_software_clip = TRUE;
gboolean needs_software_clip = FALSE;
CoglClipStack *clip_entry;
@ -1754,15 +1753,7 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
return TRUE;
}
if (clip_entry->type == COGL_CLIP_STACK_WINDOW_RECT)
{
/* XXX: technically we could still run the software clip in
* this case because for our purposes we know this clip
* can be ignored now, but [can_]sofware_clip_entry() doesn't
* know this and will bail out. */
can_software_clip = FALSE;
}
else if (clip_entry->type == COGL_CLIP_STACK_RECT)
if (clip_entry->type == COGL_CLIP_STACK_RECT)
{
CoglClipStackRect *rect_entry = (CoglClipStackRect *)entry;
@ -1781,9 +1772,6 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
ClipBounds clip_bounds;
float poly[16];
if (!can_software_clip)
return FALSE;
if (!can_software_clip_entry (entry, NULL,
entry->clip_stack, &clip_bounds))
return FALSE;

View file

@ -536,11 +536,6 @@ _cogl_clip_stack_gl_flush (CoglClipStack *stack,
}
break;
}
case COGL_CLIP_STACK_WINDOW_RECT:
break;
/* We don't need to do anything for window space rectangles because
* their functionality is entirely implemented by the entry bounding
* box */
}
}
}