[sysprof/wip/visualizers] line-visualizer-row: only queue draw when using widget style
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/visualizers] line-visualizer-row: only queue draw when using widget style
- Date: Wed, 28 Sep 2016 01:33:38 +0000 (UTC)
commit 21ed742215bf89d454a5a66d2fb2083254dd0c0c
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 27 18:30:55 2016 -0700
line-visualizer-row: only queue draw when using widget style
We can avoid queuing a new draw request if we are not using
the default styling of the widget in the line drawing.
lib/sp-line-visualizer-row.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/lib/sp-line-visualizer-row.c b/lib/sp-line-visualizer-row.c
index f032e1a..4f3ff25 100644
--- a/lib/sp-line-visualizer-row.c
+++ b/lib/sp-line-visualizer-row.c
@@ -421,12 +421,26 @@ static void
sp_line_visualizer_row_style_updated (GtkWidget *widget)
{
SpLineVisualizerRow *self = (SpLineVisualizerRow *)widget;
+ SpLineVisualizerRowPrivate *priv = sp_line_visualizer_row_get_instance_private (self);
g_assert (SP_IS_LINE_VISUALIZER_ROW (self));
GTK_WIDGET_CLASS (sp_line_visualizer_row_parent_class)->style_updated (widget);
- sp_line_visualizer_row_begin_offscreen_draw (self);
+ /*
+ * Only queue a draw if a line that is drawn relies on the the style context
+ * of the widget (as opposed to a style set manually).
+ */
+ for (guint i = 0; i < priv->lines->len; i++)
+ {
+ const LineInfo *line_info = &g_array_index (priv->lines, LineInfo, i);
+
+ if (line_info->use_default_style)
+ {
+ sp_line_visualizer_row_begin_offscreen_draw (self);
+ break;
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]