[gtk+/wip/treeview: 1/6] treeview: Only compute parity once when rendering
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/treeview: 1/6] treeview: Only compute parity once when rendering
- Date: Thu, 10 Nov 2011 20:20:13 +0000 (UTC)
commit 86c172d1589467ebb6c0ef648233f758e5aecd80
Author: Benjamin Otte <otte redhat com>
Date: Thu Jul 7 08:46:05 2011 +0200
treeview: Only compute parity once when rendering
This shouldn't affect performance too much, but it I just found it so I
fixed it.
gtk/gtktreeview.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 009faea..b21f7f6 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4706,6 +4706,7 @@ gtk_tree_view_bin_draw (GtkWidget *widget,
gboolean draw_vgrid_lines, draw_hgrid_lines;
GtkStyleContext *context;
GtkStateFlags state;
+ gboolean parity;
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
context = gtk_widget_get_style_context (widget);
@@ -4817,15 +4818,17 @@ gtk_tree_view_bin_draw (GtkWidget *widget,
* start at the first node of the event, and walk the tree in
* order, drawing each successive node.
*/
+
+ parity = !_gtk_rbtree_node_find_parity (tree, node);
do
{
- gboolean parity;
gboolean is_separator = FALSE;
gboolean is_first = FALSE;
gboolean is_last = FALSE;
gint n_col = 0;
+ parity = !parity;
is_separator = row_is_separator (tree_view, &iter, NULL);
max_height = gtk_tree_view_get_row_height (tree_view, node);
@@ -4845,8 +4848,6 @@ gtk_tree_view_bin_draw (GtkWidget *widget,
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
flags |= GTK_CELL_RENDERER_SELECTED;
- parity = _gtk_rbtree_node_find_parity (tree, node);
-
/* we *need* to set cell data on all cells before the call
* to _has_can_focus_cell, else _has_can_focus_cell() does not
* return a correct value.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]