[mutter] preview-widget: Remove meta_preview_get_clip_region



commit c2a0719e44e6df75733679d16decd9f154f2d932
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 12 01:06:41 2012 -0400

    preview-widget: Remove meta_preview_get_clip_region
    
    The concept of a clip region doesn't make sense now that we have anti-aliased
    corners and a full alpha channel. Once the theme transition is complete,
    creating a preview image with an alpha channel will be possible by passing
    an ARGB surface to gtk_widget_draw(preview_widget, ...);
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676052

 src/meta/preview-widget.h |    4 --
 src/ui/preview-widget.c   |  114 ---------------------------------------------
 2 files changed, 0 insertions(+), 118 deletions(-)
---
diff --git a/src/meta/preview-widget.h b/src/meta/preview-widget.h
index cbc7580..2c1db95 100644
--- a/src/meta/preview-widget.h
+++ b/src/meta/preview-widget.h
@@ -78,10 +78,6 @@ void meta_preview_set_frame_flags   (MetaPreview            *preview,
 void meta_preview_set_button_layout (MetaPreview            *preview,
                                      const MetaButtonLayout *button_layout);
 
-cairo_region_t * meta_preview_get_clip_region (MetaPreview *preview,
-                                               gint         new_window_width,
-                                               gint         new_window_height);
-
 GdkPixbuf* meta_preview_get_icon (void);
 GdkPixbuf* meta_preview_get_mini_icon (void);
 
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index 9934901..a411e8a 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -465,117 +465,3 @@ meta_preview_get_mini_icon (void)
   
   return default_icon;
 }
-
-cairo_region_t *
-meta_preview_get_clip_region (MetaPreview *preview, gint new_window_width, gint new_window_height)
-{
-  cairo_rectangle_int_t xrect;
-  cairo_region_t *corners_xregion, *window_xregion;
-  gint flags;
-  MetaFrameLayout *fgeom;
-  MetaFrameStyle *frame_style;
-
-  g_return_val_if_fail (META_IS_PREVIEW (preview), NULL);
-
-  flags = (META_PREVIEW (preview)->flags);
-
-  window_xregion = cairo_region_create ();
-
-  xrect.x = 0;
-  xrect.y = 0;
-  xrect.width = new_window_width;
-  xrect.height = new_window_height;
-
-  cairo_region_union_rectangle (window_xregion, &xrect);
-
-  if (preview->theme == NULL)
-    return window_xregion;
-
-  /* Otherwise, we do have a theme, so calculate the corners */
-  frame_style = meta_theme_get_frame_style (preview->theme,
-      META_FRAME_TYPE_NORMAL, flags);
-
-  fgeom = frame_style->layout;
-
-  corners_xregion = cairo_region_create ();
-
-  if (fgeom->top_left_corner_rounded_radius != 0)
-    {
-      const int corner = fgeom->top_left_corner_rounded_radius;
-      const float radius = sqrt(corner) + corner;
-      int i;
-
-      for (i=0; i<corner; i++)
-        {
-
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
-          xrect.x = 0;
-          xrect.y = i;
-          xrect.width = width;
-          xrect.height = 1;
-
-          cairo_region_union_rectangle (corners_xregion, &xrect);
-        }
-    }
-
-  if (fgeom->top_right_corner_rounded_radius != 0)
-    {
-      const int corner = fgeom->top_right_corner_rounded_radius;
-      const float radius = sqrt(corner) + corner;
-      int i;
-
-      for (i=0; i<corner; i++)
-        {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
-          xrect.x = new_window_width - width;
-          xrect.y = i;
-          xrect.width = width;
-          xrect.height = 1;
-
-          cairo_region_union_rectangle (corners_xregion, &xrect);
-        }
-    }
-
-  if (fgeom->bottom_left_corner_rounded_radius != 0)
-    {
-      const int corner = fgeom->bottom_left_corner_rounded_radius;
-      const float radius = sqrt(corner) + corner;
-      int i;
-
-      for (i=0; i<corner; i++)
-        {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
-          xrect.x = 0;
-          xrect.y = new_window_height - i - 1;
-          xrect.width = width;
-          xrect.height = 1;
-
-          cairo_region_union_rectangle (corners_xregion, &xrect);
-        }
-    }
-
-  if (fgeom->bottom_right_corner_rounded_radius != 0)
-    {
-      const int corner = fgeom->bottom_right_corner_rounded_radius;
-      const float radius = sqrt(corner) + corner;
-      int i;
-
-      for (i=0; i<corner; i++)
-        {
-          const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
-          xrect.x = new_window_width - width;
-          xrect.y = new_window_height - i - 1;
-          xrect.width = width;
-          xrect.height = 1;
-
-          cairo_region_union_rectangle (corners_xregion, &xrect);
-        }
-    }
-
-  cairo_region_subtract (window_xregion, corners_xregion);
-  cairo_region_destroy (corners_xregion);
-
-  return window_xregion;
-}
-
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]