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

This commit is contained in:
Massimo Valentini 2011-09-08 18:30:23 +02:00
parent 7c127fdb0c
commit 8b8e67ffe2
3 changed files with 11 additions and 25 deletions

View File

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

View File

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

View File

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