[gimp] Bug 656129: Warnings: render_image_tile_fault: assertion `tile[4]...



commit 8b8e67ffe286d78044266fae45141b90d93855a9
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Thu Sep 8 18:30:23 2011 +0200

    Bug 656129: Warnings: render_image_tile_fault: assertion `tile[4]...

 app/display/gimpdisplayshell-draw.c   |   24 +++++-------------------
 app/display/gimpdisplayshell-render.c |    8 ++++----
 app/display/gimpdisplayshell.c        |    4 ++--
 3 files changed, 11 insertions(+), 25 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index af27310..33d369b 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -85,14 +85,9 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
                                                          gint             *w,
                                                          gint             *h)
 {
-  GimpImage      *image;
-  GimpProjection *proj;
-  TileManager    *tiles;
-  gdouble         scale_x;
-  gdouble         scale_y;
-  gint            level;
-  gint            level_width;
-  gint            level_height;
+  GimpImage *image;
+  gdouble    scale_x;
+  gdouble    scale_y;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
@@ -100,19 +95,10 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell
 
   g_return_if_fail (GIMP_IS_IMAGE (image));
 
-  proj = gimp_image_get_projection (image);
-
   gimp_display_shell_calculate_scale_x_and_y (shell, scale, &scale_x, &scale_y);
 
-  level = gimp_projection_get_level (proj, scale_x, scale_y);
-
-  tiles = gimp_projection_get_tiles_at_level (proj, level, NULL);
-
-  level_width  = tile_manager_width (tiles);
-  level_height = tile_manager_height (tiles);
-
-  if (w) *w = PROJ_ROUND (level_width  * (scale_x * (1 << level)));
-  if (h) *h = PROJ_ROUND (level_height * (scale_y * (1 << level)));
+  if (w) *w = scale_x * gimp_image_get_width (image);
+  if (h) *h = scale_y * gimp_image_get_height (image);
 }
 
 void
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index 0c07cf1..b74ce94 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -384,8 +384,8 @@ gimp_display_shell_render_info_init (RenderInfo       *info,
   info->full_scaley = shell->scale_y;
 
   /* use Bresenham like stepping */
-  info->x_dest_inc  = shell->x_dest_inc;
-  info->x_src_dec   = shell->x_src_dec << level;
+  info->x_dest_inc  = shell->x_dest_inc >> level;
+  info->x_src_dec   = shell->x_src_dec;
 
   info->dx_start    = ((gint64) info->x_dest_inc * info->x
                        + info->x_dest_inc / 2);
@@ -394,8 +394,8 @@ gimp_display_shell_render_info_init (RenderInfo       *info,
   info->dx_start    = info->dx_start % info->x_src_dec;
 
   /* same for y */
-  info->y_dest_inc  = shell->y_dest_inc;
-  info->y_src_dec   = shell->y_src_dec << level;
+  info->y_dest_inc  = shell->y_dest_inc >> level;
+  info->y_src_dec   = shell->y_src_dec;
 
   info->dy_start    = ((gint64) info->y_dest_inc * info->y
                        + info->y_dest_inc / 2);
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 8a64fcb..e522823 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -1410,8 +1410,8 @@ gimp_display_shell_scale_changed (GimpDisplayShell *shell)
 
       shell->x_dest_inc = gimp_image_get_width  (image);
       shell->y_dest_inc = gimp_image_get_height (image);
-      shell->x_src_dec  = SCALEX (shell, gimp_image_get_width  (image));
-      shell->y_src_dec  = SCALEY (shell, gimp_image_get_height (image));
+      shell->x_src_dec  = shell->scale_x * shell->x_dest_inc;
+      shell->y_src_dec  = shell->scale_y * shell->y_dest_inc;
 
       if (shell->x_src_dec < 1)
         shell->x_src_dec = 1;



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