mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
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.
This commit is contained in:
@ -421,12 +421,26 @@ static void
|
|||||||
sp_line_visualizer_row_style_updated (GtkWidget *widget)
|
sp_line_visualizer_row_style_updated (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
SpLineVisualizerRow *self = (SpLineVisualizerRow *)widget;
|
SpLineVisualizerRow *self = (SpLineVisualizerRow *)widget;
|
||||||
|
SpLineVisualizerRowPrivate *priv = sp_line_visualizer_row_get_instance_private (self);
|
||||||
|
|
||||||
g_assert (SP_IS_LINE_VISUALIZER_ROW (self));
|
g_assert (SP_IS_LINE_VISUALIZER_ROW (self));
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (sp_line_visualizer_row_parent_class)->style_updated (widget);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user