use nearest neighbour resampling when rendering for a 1byte per pixel

* app/display/gimpdisplayshell-render.c: (render_image_tile_fault):
use nearest neighbour resampling when rendering for a 1byte per pixel
drawable (ony happens when interacting with the SIOX tool, and then
the buffer is a indexed; not a greyscale buffer), fixes bug #472027.

svn path=/trunk/; revision=23424
This commit is contained in:
Øyvind Kolås 2007-08-31 10:04:37 +00:00
parent b520112784
commit aec18403a9
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2007-08-31 Øyvind Kolås <pippin@gimp.org>
* app/display/gimpdisplayshell-render.c: (render_image_tile_fault):
use nearest neighbour resampling when rendering for a 1byte per pixel
drawable (ony happens when interacting with the SIOX tool, and then
the buffer is a indexed; not a greyscale buffer), fixes bug #472027.
2007-08-31 Raphaël Quinet <raphael@gimp.org> 2007-08-31 Raphaël Quinet <raphael@gimp.org>
* app/display/gimpdisplayshell-render.c (render_image_tile_fault): * app/display/gimpdisplayshell-render.c (render_image_tile_fault):

View File

@ -1064,11 +1064,11 @@ render_image_tile_fault (RenderInfo *info)
guint bottom_weight; guint bottom_weight;
/* dispatch to fast path functions on special conditions */ /* dispatch to fast path functions on special conditions */
if ((gimp_zoom_quality & GIMP_DISPLAY_ZOOM_FAST) || if ((gimp_zoom_quality & GIMP_DISPLAY_ZOOM_FAST)
/* use nearest neighbour for exact levels */ /* use nearest neighbour for exact levels */
(info->scalex == 1.0 && || (info->scalex == 1.0 &&
info->scaley == 1.0) info->scaley == 1.0)
/* or when we're larger than 1.0 and not using any AA */ /* or when we're larger than 1.0 and not using any AA */
|| (info->shell->scale_x > 1.0 && || (info->shell->scale_x > 1.0 &&
@ -1078,6 +1078,11 @@ render_image_tile_fault (RenderInfo *info)
/* or at any point when both scale factors are greater or equal to 200% */ /* or at any point when both scale factors are greater or equal to 200% */
|| (info->shell->scale_x >= 2.0 && || (info->shell->scale_x >= 2.0 &&
info->shell->scale_y >= 2.0 ) info->shell->scale_y >= 2.0 )
/* or when we're scaling a 1bpp texture, this code-path seems to be
* invoked when interacting with SIOX which uses a palletized drawable
*/
|| (tile_manager_bpp (info->src_tiles)==1)
) )
{ {
return render_image_tile_fault_nearest (info); return render_image_tile_fault_nearest (info);