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.
This commit is contained in:
Ell 2019-09-04 14:37:38 +03:00
parent 7f629a630c
commit 1f9d0d275c
4 changed files with 19 additions and 15 deletions

View File

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

View File

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

View File

@ -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,

View File

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