summaryrefslogtreecommitdiff
path: root/src/compositor/meta-shaped-texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/meta-shaped-texture.c')
-rw-r--r--src/compositor/meta-shaped-texture.c115
1 files changed, 4 insertions, 111 deletions
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index ae219451d..f560ac90c 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -77,9 +77,6 @@ struct _MetaShapedTexturePrivate
cairo_region_t *clip_region;
cairo_region_t *shape_region;
- cairo_region_t *overlay_region;
- cairo_path_t *overlay_path;
-
guint tex_width, tex_height;
guint mask_width, mask_height;
@@ -111,8 +108,6 @@ meta_shaped_texture_init (MetaShapedTexture *self)
priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self);
priv->shape_region = NULL;
- priv->overlay_path = NULL;
- priv->overlay_region = NULL;
priv->paint_tower = meta_texture_tower_new ();
priv->texture = COGL_INVALID_HANDLE;
priv->mask_texture = COGL_INVALID_HANDLE;
@@ -149,7 +144,6 @@ meta_shaped_texture_dispose (GObject *object)
meta_shaped_texture_set_shape_region (self, NULL);
meta_shaped_texture_set_clip_region (self, NULL);
- meta_shaped_texture_set_overlay_path (self, NULL, NULL);
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object);
}
@@ -170,59 +164,6 @@ meta_shaped_texture_dirty_mask (MetaShapedTexture *stex)
}
static void
-install_overlay_path (MetaShapedTexture *stex,
- guchar *mask_data,
- int tex_width,
- int tex_height,
- int stride)
-{
- MetaShapedTexturePrivate *priv = stex->priv;
- int i, n_rects;
- cairo_t *cr;
- cairo_rectangle_int_t rect;
- cairo_surface_t *surface;
-
- if (priv->overlay_region == NULL)
- return;
-
- surface = cairo_image_surface_create_for_data (mask_data,
- CAIRO_FORMAT_A8,
- tex_width,
- tex_height,
- stride);
-
- cr = cairo_create (surface);
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
-
- n_rects = cairo_region_num_rectangles (priv->overlay_region);
- for (i = 0; i < n_rects; i++)
- {
- cairo_region_get_rectangle (priv->overlay_region, i, &rect);
- cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
- }
-
- cairo_fill_preserve (cr);
- if (priv->overlay_path == NULL)
- {
- /* If we have an overlay region but not an overlay path, then we
- * just need to clear the rectangles in the overlay region. */
- goto out;
- }
-
- cairo_clip (cr);
-
- cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_set_source_rgba (cr, 1, 1, 1, 1);
-
- cairo_append_path (cr, priv->overlay_path);
- cairo_fill (cr);
-
- out:
- cairo_destroy (cr);
- cairo_surface_destroy (surface);
-}
-
-static void
meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
{
MetaShapedTexturePrivate *priv = stex->priv;
@@ -251,14 +192,10 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
int n_rects;
int stride;
- /* If we have no shape region and no (or an empty) overlay region, we
- * don't need to create a full mask texture, so quit early. */
- if (priv->shape_region == NULL &&
- (priv->overlay_region == NULL ||
- cairo_region_num_rectangles (priv->overlay_region) == 0))
- {
- return;
- }
+ /* If we have no shape region, we don't need to create
+ * a full mask texture, so quit early. */
+ if (priv->shape_region == NULL)
+ return;
stride = cairo_format_stride_for_width (CAIRO_FORMAT_A8, tex_width);
@@ -290,8 +227,6 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
memset (p, 255, x2 - x1);
}
- install_overlay_path (stex, mask_data, tex_width, tex_height, stride);
-
if (meta_texture_rectangle_check (paint_tex))
priv->mask_texture = meta_texture_rectangle_new (tex_width, tex_height,
COGL_PIXEL_FORMAT_A_8,
@@ -728,48 +663,6 @@ meta_shaped_texture_get_texture (MetaShapedTexture *stex)
}
/**
- * meta_shaped_texture_set_overlay_path:
- * @stex: a #MetaShapedTexture
- * @overlay_region: A region containing the parts of the mask to overlay.
- * All rectangles in this region are wiped clear to full transparency,
- * and the overlay path is clipped to this region.
- * @overlay_path: (transfer full): This path will be painted onto the mask
- * texture with a fully opaque source. Due to the lack of refcounting
- * in #cairo_path_t, ownership of the path is assumed.
- */
-void
-meta_shaped_texture_set_overlay_path (MetaShapedTexture *stex,
- cairo_region_t *overlay_region,
- cairo_path_t *overlay_path)
-{
- MetaShapedTexturePrivate *priv;
-
- g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
-
- priv = stex->priv;
-
- if (priv->overlay_region != NULL)
- {
- cairo_region_destroy (priv->overlay_region);
- priv->overlay_region = NULL;
- }
-
- if (priv->overlay_path != NULL)
- {
- cairo_path_destroy (priv->overlay_path);
- priv->overlay_path = NULL;
- }
-
- cairo_region_reference (overlay_region);
- priv->overlay_region = overlay_region;
-
- /* cairo_path_t does not have refcounting. */
- priv->overlay_path = overlay_path;
-
- meta_shaped_texture_dirty_mask (stex);
-}
-
-/**
* meta_shaped_texture_set_clip_region:
* @stex: a #MetaShapedTexture
* @clip_region: (transfer full): the region of the texture that