Revert "st-theme-node-drawing: Group multiple cogl_rectangle calls"

This reverts commit 4fa914af31.

Pushed to wrong branch.
This commit is contained in:
Adel Gadllah 2012-11-16 19:27:40 +01:00
parent 2839670719
commit 8f1282ea6a

View File

@ -1553,7 +1553,7 @@ st_theme_node_paint_borders (StThemeNode *node,
{ {
ClutterColor effective_border; ClutterColor effective_border;
gboolean skip_corner_1, skip_corner_2; gboolean skip_corner_1, skip_corner_2;
float rects[16]; float x1, y1, x2, y2;
over (&border_color, &node->background_color, &effective_border); over (&border_color, &node->background_color, &effective_border);
alpha = paint_opacity * effective_border.alpha / 255; 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_1 = border_radius[ST_CORNER_TOPLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_TOPRIGHT] > 0; skip_corner_2 = border_radius[ST_CORNER_TOPRIGHT] > 0;
rects[0] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0; x1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] : 0;
rects[1] = 0; y1 = 0;
rects[2] = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width; x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_TOPRIGHT] : width;
rects[3] = border_width[ST_SIDE_TOP]; y2 = border_width[ST_SIDE_TOP];
cogl_rectangle (x1, y1, x2, y2);
/* EAST */ /* EAST */
skip_corner_1 = border_radius[ST_CORNER_TOPRIGHT] > 0; skip_corner_1 = border_radius[ST_CORNER_TOPRIGHT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0; skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0;
rects[4] = width - border_width[ST_SIDE_RIGHT]; x1 = width - border_width[ST_SIDE_RIGHT];
rects[5] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT] y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPRIGHT]
: border_width[ST_SIDE_TOP]; : border_width[ST_SIDE_TOP];
rects[6] = width; x2 = width;
rects[7] = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT] y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMRIGHT]
: height - border_width[ST_SIDE_BOTTOM]; : height - border_width[ST_SIDE_BOTTOM];
cogl_rectangle (x1, y1, x2, y2);
/* SOUTH */ /* SOUTH */
skip_corner_1 = border_radius[ST_CORNER_BOTTOMLEFT] > 0; skip_corner_1 = border_radius[ST_CORNER_BOTTOMLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0; skip_corner_2 = border_radius[ST_CORNER_BOTTOMRIGHT] > 0;
rects[8] = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0; x1 = skip_corner_1 ? max_width_radius[ST_CORNER_BOTTOMLEFT] : 0;
rects[9] = height - border_width[ST_SIDE_BOTTOM]; y1 = height - border_width[ST_SIDE_BOTTOM];
rects[10] = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT] x2 = skip_corner_2 ? width - max_width_radius[ST_CORNER_BOTTOMRIGHT]
: width; : width;
rects[11] = height; y2 = height;
cogl_rectangle (x1, y1, x2, y2);
/* WEST */ /* WEST */
skip_corner_1 = border_radius[ST_CORNER_TOPLEFT] > 0; skip_corner_1 = border_radius[ST_CORNER_TOPLEFT] > 0;
skip_corner_2 = border_radius[ST_CORNER_BOTTOMLEFT] > 0; skip_corner_2 = border_radius[ST_CORNER_BOTTOMLEFT] > 0;
rects[12] = 0; x1 = 0;
rects[13] = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT] y1 = skip_corner_1 ? max_width_radius[ST_CORNER_TOPLEFT]
: border_width[ST_SIDE_TOP]; : border_width[ST_SIDE_TOP];
rects[14] = border_width[ST_SIDE_LEFT]; x2 = border_width[ST_SIDE_LEFT];
rects[15] = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT] y2 = skip_corner_2 ? height - max_width_radius[ST_CORNER_BOTTOMLEFT]
: height - border_width[ST_SIDE_BOTTOM]; : height - border_width[ST_SIDE_BOTTOM];
cogl_rectangle (x1, y1, x2, y2);
cogl_rectangles (rects, 4);
} }
} }
@ -1873,7 +1875,6 @@ st_theme_node_paint_outline (StThemeNode *node,
{ {
float width, height; float width, height;
int outline_width; int outline_width;
float rects[16];
ClutterColor outline_color, effective_outline; ClutterColor outline_color, effective_outline;
width = box->x2 - box->x1; width = box->x2 - box->x1;
@ -1898,30 +1899,20 @@ st_theme_node_paint_outline (StThemeNode *node,
*/ */
/* NORTH */ /* NORTH */
rects[0] = -outline_width; cogl_rectangle (-outline_width, -outline_width,
rects[1] = -outline_width; width + outline_width, 0);
rects[2] = width + outline_width;
rects[3] = 0;
/* EAST */ /* EAST */
rects[4] = width; cogl_rectangle (width, 0,
rects[5] = 0; width + outline_width, height);
rects[6] = width + outline_width;
rects[7] = height;
/* SOUTH */ /* SOUTH */
rects[8] = -outline_width; cogl_rectangle (-outline_width, height,
rects[9] = height; width + outline_width, height + outline_width);
rects[10] = width + outline_width;
rects[11] = height + outline_width;
/* WEST */ /* WEST */
rects[12] = -outline_width; cogl_rectangle (-outline_width, 0,
rects[13] = 0; 0, height);
rects[14] = 0;
rects[15] = height;
cogl_rectangles (rects, 4);
} }
void void