mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-10 12:40:10 +00:00
Limit parallelizm for small mipmaps too
Apply the same ideas that we use for memory format and color conversions, to avoid overhead for small sizes.
This commit is contained in:
parent
c9d73c1c19
commit
dc3ad33a43
@ -2690,19 +2690,24 @@ gdk_memory_mipmap (guchar *dest,
|
||||
.linear = linear,
|
||||
.rows_done = 0,
|
||||
};
|
||||
gsize chunk_size;
|
||||
guint n_tasks;
|
||||
|
||||
g_assert (lod_level > 0);
|
||||
|
||||
chunk_size = MAX (1, 512 / src_width),
|
||||
n_tasks = (src_height + chunk_size - 1) / chunk_size;
|
||||
|
||||
if (dest_format == src_format)
|
||||
{
|
||||
if (linear)
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_same_format_linear, &mipmap, G_MAXUINT);
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_same_format_linear, &mipmap, n_tasks);
|
||||
else
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_same_format_nearest, &mipmap, G_MAXUINT);
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_same_format_nearest, &mipmap, n_tasks);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_generic, &mipmap, G_MAXUINT);
|
||||
gdk_parallel_task_run (gdk_memory_mipmap_generic, &mipmap, n_tasks);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user