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);