summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <tthurman@gnome.org>2009-10-23 16:06:10 -0400
committerThomas Thurman <tthurman@gnome.org>2009-10-23 16:06:10 -0400
commit505c7d164f241abe3aa9c45bc551e35c804d2a4f (patch)
tree6b1b25a74ae923cbff99b1eb88a2152a2bf2e40f
parent0272e221d510bc17fcf867cead4bf3ea07034988 (diff)
downloadmetacity-505c7d164f241abe3aa9c45bc551e35c804d2a4f.tar.gz
move draw_rectangle inline, and there was much rejoicing
-rw-r--r--src/ui/theme.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 177c8dc9..4045f09d 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -313,27 +313,6 @@ meta_theme_get_title_scale (MetaTheme *theme,
return 1.0;
}
-/*
- * FIXME: This is only called in one place;
- * shd be inlined
- */
-static void
-draw_rectangle (ccss_stylesheet_t *stylesheet,
- cairo_t *cr,
- CopperClasses style_id,
- int x, int y, int w, int h,
- gboolean honour_margins,
- PangoLayout *layout)
-{
- ccss_style_t *style = ccss_stylesheet_query (stylesheet,
- (ccss_node_t*) &cowbell_nodes[style_id]);
- if (!style || w==0 || h==0) return;
-
- ccss_cairo_style_draw_rectangle (style, cr, x, y, w, h);
-
- ccss_style_destroy (style);
-}
-
static void
cowbell_style_title_text (ccss_stylesheet_t *stylesheet,
PangoLayout *layout,
@@ -427,14 +406,18 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
for (i=0; i<CC_LAST; i++)
{
- draw_rectangle (stylesheet, cr, i,
- fgeom.areas[i].x,
- fgeom.areas[i].y,
- fgeom.areas[i].width,
- fgeom.areas[i].height,
- i != CC_FRAME /* honour_margins */,
- title_layout);
+ ccss_style_t *style = ccss_stylesheet_query (stylesheet,
+ (ccss_node_t*) &cowbell_nodes[i]);
+ if (!style ||
+ fgeom.areas[i].width == 0 ||
+ fgeom.areas[i].height == 0)
+ continue;
+ ccss_cairo_style_draw_rectangle (style, cr,
+ fgeom.areas[i].x,
+ fgeom.areas[i].y,
+ fgeom.areas[i].width,
+ fgeom.areas[i].height);
}
/* may be worth moving this inline? */