[gthumb] cairo scale: do not check task cancellation after each pixel



commit 96a2cf7dea2386e0f175822c756795df28bf9e11
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Sep 24 23:10:50 2013 +0200

    cairo scale: do not check task cancellation after each pixel
    
    check after each row, to enhance performance

 gthumb/cairo-scale.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gthumb/cairo-scale.c b/gthumb/cairo-scale.c
index 9f293b9..65b499b 100644
--- a/gthumb/cairo-scale.c
+++ b/gthumb/cairo-scale.c
@@ -404,7 +404,13 @@ horizontal_scale_transpose (cairo_surface_t *image,
 #endif /* HAVE_VECTOR_OPERATIONS */
 
                if (resize_filter->task != NULL) {
-                       double progress = (double) resize_filter->processed_lines++ / 
resize_filter->total_lines;
+                       double progress;
+
+                       gth_async_task_get_data (resize_filter->task, NULL, &resize_filter->cancelled, NULL);
+                       if (resize_filter->cancelled)
+                               goto out;
+
+                       progress = (double) resize_filter->processed_lines++ / resize_filter->total_lines;
                        gth_async_task_set_data (resize_filter->task, NULL, NULL, &progress);
                }
 
@@ -434,12 +440,6 @@ horizontal_scale_transpose (cairo_surface_t *image,
                for (x = 0; x < scaled_width; x++) {
                        guchar *p_src_pixel;
 
-                       if (resize_filter->task != NULL) {
-                               gth_async_task_get_data (resize_filter->task, NULL, 
&resize_filter->cancelled, NULL);
-                               if (resize_filter->cancelled)
-                                       goto out;
-                       }
-
                        p_src_pixel = p_src_row;
 
 #ifdef HAVE_VECTOR_OPERATIONS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]