Commit 6cf8bda4 authored by Massimo Valentini's avatar Massimo Valentini Committed by Michael Natterer

Bug 735810 - performance shrinkage of Paths tool

In gimp_display_shell_expose_region(), invalidate each rect rather
than rebuilding the cairo_region_t as GdkRegion and then invalidating
the entire GdkRegion. Improves performance for tools that invalidate
complex regions.
parent 4920033c
......@@ -42,7 +42,7 @@ void
gimp_display_shell_expose_region (GimpDisplayShell *shell,
cairo_region_t *region)
GdkRegion *gdk_region;
GdkWindow *window;
gint n_rectangles;
gint i;
......@@ -52,7 +52,7 @@ gimp_display_shell_expose_region (GimpDisplayShell *shell,
if (! gtk_widget_get_realized (shell->canvas))
gdk_region = gdk_region_new ();
window = gtk_widget_get_window (shell->canvas);
n_rectangles = cairo_region_num_rectangles (region);
for (i = 0; i < n_rectangles; i++)
......@@ -61,12 +61,10 @@ gimp_display_shell_expose_region (GimpDisplayShell *shell,
cairo_region_get_rectangle (region, i, &rectangle);
gdk_region_union_with_rect (gdk_region, (GdkRectangle *) &rectangle);
gdk_window_invalidate_rect (window,
(GdkRectangle *) &rectangle,
gdk_window_invalidate_region (gtk_widget_get_window (shell->canvas),
gdk_region, TRUE);
gdk_region_destroy (gdk_region);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment