summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2023-05-16 18:57:42 -0300
committerMarge Bot <marge-bot@gnome.org>2023-05-17 15:09:45 +0000
commit3b7ca42c6f5d06874a31d5435cfd58ea68032d24 (patch)
tree11ea758de0931e2a32c824e63d014b0268c7038f
parent656ccb4dee9d8236c4e91c1e2fc13b22f8793722 (diff)
downloadmutter-main.tar.gz
cogl/clip-stack: Removing window rectHEADmain
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>
-rw-r--r--cogl/cogl/cogl-clip-stack.c24
-rw-r--r--cogl/cogl/cogl-clip-stack.h16
-rw-r--r--cogl/cogl/cogl-journal.c14
-rw-r--r--cogl/cogl/driver/gl/cogl-clip-stack-gl.c5
4 files changed, 1 insertions, 58 deletions
diff --git a/cogl/cogl/cogl-clip-stack.c b/cogl/cogl/cogl-clip-stack.c
index 4212810ae..74f031bea 100644
--- a/cogl/cogl/cogl-clip-stack.c
+++ b/cogl/cogl/cogl-clip-stack.c
@@ -128,27 +128,6 @@ _cogl_clip_stack_entry_set_bounds (CoglClipStack *entry,
}
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,
float y_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 =
diff --git a/cogl/cogl/cogl-clip-stack.h b/cogl/cogl/cogl-clip-stack.h
index 2efaa2777..3df72b36e 100644
--- a/cogl/cogl/cogl-clip-stack.h
+++ b/cogl/cogl/cogl-clip-stack.h
@@ -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,
diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c
index 4ed508a7f..becdc0f7f 100644
--- a/cogl/cogl/cogl-journal.c
+++ b/cogl/cogl/cogl-journal.c
@@ -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;
diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
index a693903b3..366cab3a1 100644
--- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
+++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c
@@ -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 */
}
}
}