[gimp] app: add gimp_image_invalidate_all()
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: add gimp_image_invalidate_all()
- Date: Wed, 4 Sep 2019 18:00:08 +0000 (UTC)
commit 1f9d0d275c8f22df625a7d37602d19abb21576f6
Author: Ell <ell_se yahoo com>
Date: Wed Sep 4 14:37:38 2019 +0300
app: add gimp_image_invalidate_all()
... which invalidates the entire image. This replaces all calls to
gimp_image_invalidate() with the full canvas size, since the image
content can now be larger than the canvas.
app/actions/debug-commands.c | 5 +----
app/core/gimpimage.c | 24 ++++++++++++++++--------
app/core/gimpimage.h | 1 +
app/file/file-open.c | 4 +---
4 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/app/actions/debug-commands.c b/app/actions/debug-commands.c
index 2d10de51cd..03dbb6f4ac 100644
--- a/app/actions/debug-commands.c
+++ b/app/actions/debug-commands.c
@@ -306,10 +306,7 @@ debug_benchmark_projection (GimpDisplay *display)
GIMP_TIMER_START ();
- gimp_image_invalidate (image,
- 0, 0,
- gimp_image_get_width (image),
- gimp_image_get_height (image));
+ gimp_image_invalidate_all (image);
gimp_projection_flush_now (projection, TRUE);
GIMP_TIMER_END ("Validation of the entire projection");
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index af5723abd4..fa432dac2d 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -1325,10 +1325,7 @@ gimp_image_real_colormap_changed (GimpImage *image,
if (gimp_image_get_base_type (image) == GIMP_INDEXED)
{
/* A colormap alteration affects the whole image */
- gimp_image_invalidate (image,
- 0, 0,
- gimp_image_get_width (image),
- gimp_image_get_height (image));
+ gimp_image_invalidate_all (image);
gimp_item_stack_invalidate_previews (GIMP_ITEM_STACK (private->layers->container));
}
@@ -3055,10 +3052,7 @@ gimp_image_set_component_visible (GimpImage *image,
gimp_image_signals[COMPONENT_VISIBILITY_CHANGED], 0,
channel);
- gimp_image_invalidate (image,
- 0, 0,
- gimp_image_get_width (image),
- gimp_image_get_height (image));
+ gimp_image_invalidate_all (image);
}
}
@@ -3167,6 +3161,20 @@ gimp_image_invalidate (GimpImage *image,
GIMP_IMAGE_GET_PRIVATE (image)->flush_accum.preview_invalidated = TRUE;
}
+void
+gimp_image_invalidate_all (GimpImage *image)
+{
+ const GeglRectangle *bounding_box;
+
+ g_return_if_fail (GIMP_IS_IMAGE (image));
+
+ bounding_box = &GIMP_IMAGE_GET_PRIVATE (image)->bounding_box;
+
+ gimp_image_invalidate (image,
+ bounding_box->x, bounding_box->y,
+ bounding_box->width, bounding_box->height);
+}
+
void
gimp_image_guide_added (GimpImage *image,
GimpGuide *guide)
diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h
index 79a2a8d0fa..6b3b998422 100644
--- a/app/core/gimpimage.h
+++ b/app/core/gimpimage.h
@@ -253,6 +253,7 @@ void gimp_image_invalidate (GimpImage *image,
gint y,
gint width,
gint height);
+void gimp_image_invalidate_all (GimpImage *image);
void gimp_image_guide_added (GimpImage *image,
GimpGuide *guide);
void gimp_image_guide_removed (GimpImage *image,
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 9f3a21b96d..09ed02db19 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -756,9 +756,7 @@ file_open_sanitize_image (GimpImage *image,
* layers, this is needed in case something triggers projection or
* image preview creation before all layers are loaded, see bug #767663.
*/
- gimp_image_invalidate (image, 0, 0,
- gimp_image_get_width (image),
- gimp_image_get_height (image));
+ gimp_image_invalidate_all (image);
/* Make sure all image states are up-to-date */
gimp_image_flush (image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]