[gimp/gimp-2-10] app: in GimpDrawableFilter, use the drawable format as the cache format
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: in GimpDrawableFilter, use the drawable format as the cache format
- Date: Fri, 28 Dec 2018 08:58:10 +0000 (UTC)
commit 37b0832c2dabf8241221b00c6fd40cdffc8b5243
Author: Ell <ell_se yahoo com>
Date: Fri Dec 28 02:13:07 2018 -0500
app: in GimpDrawableFilter, use the drawable format as the cache format
In GimpDrawableFilter, set the applicator's output format to the
drawable format, so that the cache uses the drawable format, and so
copying the cached result to the drawble's buffer when comitting
the filter becomes much cheaper, and, in particular, doesn't
require reading tiles out of the swap. This notably improves
commit speed in large images, at the expense of requiring a few
extra conversions during preview.
(cherry picked from commit 8e57ee22657726aa2b6b381d7f61cab825e81dda)
app/core/gimpdrawablefilter.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
---
diff --git a/app/core/gimpdrawablefilter.c b/app/core/gimpdrawablefilter.c
index bd0f7e7435..c392768331 100644
--- a/app/core/gimpdrawablefilter.c
+++ b/app/core/gimpdrawablefilter.c
@@ -100,6 +100,7 @@ static void gimp_drawable_filter_sync_preview (GimpDrawableFilter *fi
static void gimp_drawable_filter_sync_opacity (GimpDrawableFilter *filter);
static void gimp_drawable_filter_sync_mode (GimpDrawableFilter *filter);
static void gimp_drawable_filter_sync_affect (GimpDrawableFilter *filter);
+static void gimp_drawable_filter_sync_format (GimpDrawableFilter *filter);
static void gimp_drawable_filter_sync_mask (GimpDrawableFilter *filter);
static void gimp_drawable_filter_sync_transform (GimpDrawableFilter *filter);
static void gimp_drawable_filter_sync_gamma_hack (GimpDrawableFilter *filter);
@@ -118,6 +119,8 @@ static void gimp_drawable_filter_mask_changed (GimpImage *im
GimpDrawableFilter *filter);
static void gimp_drawable_filter_profile_changed (GimpColorManaged *managed,
GimpDrawableFilter *filter);
+static void gimp_drawable_filter_format_changed (GimpDrawable *drawable,
+ GimpDrawableFilter *filter);
static void gimp_drawable_filter_drawable_removed (GimpDrawable *drawable,
GimpDrawableFilter *filter);
@@ -651,6 +654,14 @@ gimp_drawable_filter_sync_affect (GimpDrawableFilter *filter)
gimp_applicator_set_affect (filter->applicator, active_mask);
}
+static void
+gimp_drawable_filter_sync_format (GimpDrawableFilter *filter)
+{
+ gimp_applicator_set_output_format (
+ filter->applicator,
+ gimp_drawable_get_format (filter->drawable));
+}
+
static void
gimp_drawable_filter_sync_mask (GimpDrawableFilter *filter)
{
@@ -854,6 +865,7 @@ gimp_drawable_filter_add_filter (GimpDrawableFilter *filter)
gimp_drawable_filter_sync_opacity (filter);
gimp_drawable_filter_sync_mode (filter);
gimp_drawable_filter_sync_affect (filter);
+ gimp_drawable_filter_sync_format (filter);
gimp_drawable_filter_sync_transform (filter);
gimp_drawable_filter_sync_gamma_hack (filter);
@@ -869,6 +881,9 @@ gimp_drawable_filter_add_filter (GimpDrawableFilter *filter)
g_signal_connect (image, "profile-changed",
G_CALLBACK (gimp_drawable_filter_profile_changed),
filter);
+ g_signal_connect (filter->drawable, "format-changed",
+ G_CALLBACK (gimp_drawable_filter_format_changed),
+ filter);
g_signal_connect (filter->drawable, "removed",
G_CALLBACK (gimp_drawable_filter_drawable_removed),
filter);
@@ -889,6 +904,9 @@ gimp_drawable_filter_remove_filter (GimpDrawableFilter *filter)
g_signal_handlers_disconnect_by_func (filter->drawable,
gimp_drawable_filter_drawable_removed,
filter);
+ g_signal_handlers_disconnect_by_func (filter->drawable,
+ gimp_drawable_filter_format_changed,
+ filter);
g_signal_handlers_disconnect_by_func (image,
gimp_drawable_filter_profile_changed,
filter);
@@ -981,6 +999,14 @@ gimp_drawable_filter_profile_changed (GimpColorManaged *managed,
gimp_drawable_filter_update_drawable (filter, NULL);
}
+static void
+gimp_drawable_filter_format_changed (GimpDrawable *drawable,
+ GimpDrawableFilter *filter)
+{
+ gimp_drawable_filter_sync_format (filter);
+ gimp_drawable_filter_update_drawable (filter, NULL);
+}
+
static void
gimp_drawable_filter_drawable_removed (GimpDrawable *drawable,
GimpDrawableFilter *filter)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]