mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
gtk-demo: Make one text scroll benchmark harder
Add underlines into the mix with the Emoji heavy text, to see if we can optimize lines.
This commit is contained in:
parent
5d0a3bd4cb
commit
e4a6101ae0
@ -116,20 +116,25 @@ populate_emoji_text (void)
|
|||||||
GtkWidget *textview;
|
GtkWidget *textview;
|
||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
GString *s;
|
GString *s;
|
||||||
|
GtkTextIter iter;
|
||||||
|
|
||||||
s = g_string_sized_new (1000 * 30 * 4);
|
s = g_string_sized_new (500 * 30 * 4);
|
||||||
|
|
||||||
for (int i = 0; i < 1000; i++)
|
for (int i = 0; i < 500; i++)
|
||||||
{
|
{
|
||||||
if (i % 2)
|
if (i % 2)
|
||||||
g_string_append (s, "x");
|
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
|
||||||
for (int j = 0; j < 30; j++)
|
for (int j = 0; j < 30; j++)
|
||||||
g_string_append (s, "💓x");
|
{
|
||||||
|
g_string_append (s, "💓");
|
||||||
|
g_string_append (s, "<span underline=\"single\" underline_color=\"red\">x</span>");
|
||||||
|
}
|
||||||
g_string_append (s, "\n");
|
g_string_append (s, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = gtk_text_buffer_new (NULL);
|
buffer = gtk_text_buffer_new (NULL);
|
||||||
gtk_text_buffer_set_text (buffer, s->str, s->len);
|
gtk_text_buffer_get_start_iter (buffer, &iter);
|
||||||
|
gtk_text_buffer_insert_markup (buffer, &iter, s->str, s->len);
|
||||||
|
|
||||||
g_string_free (s, TRUE);
|
g_string_free (s, TRUE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user