[gimp] app: avoid unnecessary work when all display filters are disabled
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: avoid unnecessary work when all display filters are disabled
- Date: Sun, 5 Nov 2017 14:03:16 +0000 (UTC)
commit 6ffa17bd330b4ed428f9b3302efb98d46ef7d17a
Author: Ell <ell_se yahoo com>
Date: Sun Nov 5 08:57:46 2017 -0500
app: avoid unnecessary work when all display filters are disabled
Return FALSE from gimp_display_shell_has_filter() when there are
filters, but they're all disabled, to avoid unnecessary extra
color conversions during rendering.
app/display/gimpdisplayshell-filter.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-filter.c b/app/display/gimpdisplayshell-filter.c
index bb69b3b..a9c8756 100644
--- a/app/display/gimpdisplayshell-filter.c
+++ b/app/display/gimpdisplayshell-filter.c
@@ -76,7 +76,18 @@ gimp_display_shell_has_filter (GimpDisplayShell *shell)
{
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
- return shell->filter_stack && shell->filter_stack->filters;
+ if (shell->filter_stack)
+ {
+ GList *iter;
+
+ for (iter = shell->filter_stack->filters; iter; iter = g_list_next (iter))
+ {
+ if (gimp_color_display_get_enabled (GIMP_COLOR_DISPLAY (iter->data)))
+ return TRUE;
+ }
+ }
+
+ return FALSE;
}
GimpColorDisplayStack *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]