[gnome-shell/gnome-3-6] Revert "st-theme-node-drawing: Group multiple cogl_rectangle calls"
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-6] Revert "st-theme-node-drawing: Group multiple cogl_rectangle calls"
- Date: Fri, 16 Nov 2012 18:26:19 +0000 (UTC)
commit 8f1282ea6ace71ac6e9799a0ba1ba01bf0e86204
Author: Adel Gadllah <adel gadllah gmail com>
Date: Fri Nov 16 19:27:40 2012 +0100
Revert "st-theme-node-drawing: Group multiple cogl_rectangle calls"
This reverts commit 4fa914af31618514c165b9d4f6610fdc6854da37.
Pushed to wrong branch.
src/st/st-theme-node-drawing.c | 67 +++++++++++++++++----------------------
1 files changed, 29 insertions(+), 38 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 8a915a1..c3424f9 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -1553,7 +1553,7 @@ st_theme_node_paint_borders (StThemeNode *node,
{
ClutterColor effective_border;
gboolean skip_corner_1, skip_corner_2;
- float rects[16];
+ float x1, y1, x2, y2;
over (&border_color, &node->background_color, &effective_border);
alpha = paint_opacity * effective_border.alpha / 255;
@@ -1569,44 +1569,46 @@ st_theme_node_paint_borders (StThemeNode *node,
skip_corner_1 = border_radius[ST_CORNER_TOPLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_TOPRIGHT] > 0;
- rects[0] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0;
- rects[1] = 0;
- rects[2] = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width;
- rects[3] = border_width[ST_SIDE_TOP];
+ x1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0;
+ y1 = 0;
+ x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width;
+ y2 = border_width[ST_SIDE_TOP];
+ cogl_rectangle (x1, y1, x2, y2);
/* EAST */
skip_corner_1 = border_radius[ST_CORNER_TOPRIGHT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0;
- rects[4] = width - border_width[ST_SIDE_RIGHT];
- rects[5] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT]
+ x1 = width - border_width[ST_SIDE_RIGHT];
+ y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT]
: border_width[ST_SIDE_TOP];
- rects[6] = width;
- rects[7] = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT]
+ x2 = width;
+ y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT]
: height - border_width[ST_SIDE_BOTTOM];
+ cogl_rectangle (x1, y1, x2, y2);
/* SOUTH */
skip_corner_1 = border_radius[ST_CORNER_BOTTOMLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0;
- rects[8] = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0;
- rects[9] = height - border_width[ST_SIDE_BOTTOM];
- rects[10] = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT]
+ x1 = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0;
+ y1 = height - border_width[ST_SIDE_BOTTOM];
+ x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT]
: width;
- rects[11] = height;
+ y2 = height;
+ cogl_rectangle (x1, y1, x2, y2);
/* WEST */
skip_corner_1 = border_radius[ST_CORNER_TOPLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMLEFT] > 0;
- rects[12] = 0;
- rects[13] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT]
+ x1 = 0;
+ y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT]
: border_width[ST_SIDE_TOP];
- rects[14] = border_width[ST_SIDE_LEFT];
- rects[15] = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT]
+ x2 = border_width[ST_SIDE_LEFT];
+ y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT]
: height - border_width[ST_SIDE_BOTTOM];
-
- cogl_rectangles (rects, 4);
+ cogl_rectangle (x1, y1, x2, y2);
}
}
@@ -1873,7 +1875,6 @@ st_theme_node_paint_outline (StThemeNode *node,
{
float width, height;
int outline_width;
- float rects[16];
ClutterColor outline_color, effective_outline;
width = box->x2 - box->x1;
@@ -1898,30 +1899,20 @@ st_theme_node_paint_outline (StThemeNode *node,
*/
/* NORTH */
- rects[0] = -outline_width;
- rects[1] = -outline_width;
- rects[2] = width + outline_width;
- rects[3] = 0;
+ cogl_rectangle (-outline_width, -outline_width,
+ width + outline_width, 0);
/* EAST */
- rects[4] = width;
- rects[5] = 0;
- rects[6] = width + outline_width;
- rects[7] = height;
+ cogl_rectangle (width, 0,
+ width + outline_width, height);
/* SOUTH */
- rects[8] = -outline_width;
- rects[9] = height;
- rects[10] = width + outline_width;
- rects[11] = height + outline_width;
+ cogl_rectangle (-outline_width, height,
+ width + outline_width, height + outline_width);
/* WEST */
- rects[12] = -outline_width;
- rects[13] = 0;
- rects[14] = 0;
- rects[15] = height;
-
- cogl_rectangles (rects, 4);
+ cogl_rectangle (-outline_width, 0,
+ 0, height);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]