oops - managed to miss the mask rendering.

2007-09-23  Simon Budig  <simon@gimp.org>

	* app/display/gimpdisplayshell-render.c: oops - managed to miss the
	mask rendering.


svn path=/trunk/; revision=23619
This commit is contained in:
Simon Budig
2007-09-23 00:57:15 +00:00
committed by Simon Budig
parent 7d0a4ce1ec
commit a26c1d7df9
2 changed files with 46 additions and 59 deletions

View File

@ -1,3 +1,8 @@
2007-09-23 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-render.c: oops - managed to miss the
mask rendering.
2007-09-23 Simon Budig <simon@gimp.org> 2007-09-23 Simon Budig <simon@gimp.org>
* app/display/gimpdisplayshell-render.c: use Bresenham stepping * app/display/gimpdisplayshell-render.c: use Bresenham stepping

View File

@ -89,7 +89,6 @@ struct _RenderInfo
gint dy_start; gint dy_start;
gint dy; gint dy;
gint yfraction;
}; };
static void gimp_display_shell_render_info_scale (RenderInfo *info, static void gimp_display_shell_render_info_scale (RenderInfo *info,
@ -395,7 +394,6 @@ gimp_display_shell_render_mask (GimpDisplayShell *shell,
{ {
gint y, ye; gint y, ye;
gint x, xe; gint x, xe;
gboolean initial = TRUE;
y = info->y; y = info->y;
ye = info->y + info->h; ye = info->y + info->h;
@ -406,74 +404,58 @@ gimp_display_shell_render_mask (GimpDisplayShell *shell,
while (TRUE) while (TRUE)
{ {
gint error = floor ((y + 1) / info->scaley) - floor (y / info->scaley); const guchar *src = info->src;
guchar *dest = info->dest;
if (!initial && (error == 0)) switch (shell->mask_color)
{ {
memcpy (info->dest, info->dest - info->dest_bpl, info->dest_width); case GIMP_RED_CHANNEL:
} for (x = info->x; x < xe; x++, src++, dest += 3)
else
{
const guchar *src = info->src;
guchar *dest = info->dest;
switch (shell->mask_color)
{ {
case GIMP_RED_CHANNEL: if (*src & 0x80)
for (x = info->x; x < xe; x++, src++, dest += 3) continue;
{
if (*src & 0x80)
continue;
dest[1] = dest[1] >> 2; dest[1] = dest[1] >> 2;
dest[2] = dest[2] >> 2; dest[2] = dest[2] >> 2;
}
break;
case GIMP_GREEN_CHANNEL:
for (x = info->x; x < xe; x++, src++, dest += 3)
{
if (*src & 0x80)
continue;
dest[0] = dest[0] >> 2;
dest[2] = dest[2] >> 2;
}
break;
case GIMP_BLUE_CHANNEL:
for (x = info->x; x < xe; x++, src++, dest += 3)
{
if (*src & 0x80)
continue;
dest[0] = dest[0] >> 2;
dest[1] = dest[1] >> 2;
}
break;
default:
break;
} }
break;
case GIMP_GREEN_CHANNEL:
for (x = info->x; x < xe; x++, src++, dest += 3)
{
if (*src & 0x80)
continue;
dest[0] = dest[0] >> 2;
dest[2] = dest[2] >> 2;
}
break;
case GIMP_BLUE_CHANNEL:
for (x = info->x; x < xe; x++, src++, dest += 3)
{
if (*src & 0x80)
continue;
dest[0] = dest[0] >> 2;
dest[1] = dest[1] >> 2;
}
break;
default:
break;
} }
if (++y == ye) if (++y == ye)
break; break;
info->dest += info->dest_bpl; info->dest += info->dest_bpl;
if (error) info->dy += info->y_dest_inc;
{ info->src_y += info->dy / info->y_src_dec;
info->src_y += error; info->dy = info->dy % info->y_src_dec;
info->yfraction = 256 * fmod (y / info->scaley, 1.0);
info->src = render_image_tile_fault (info);
initial = TRUE; info->src = render_image_tile_fault (info);
}
else
{
initial = FALSE;
}
} }
} }
@ -592,7 +574,7 @@ render_image_rgb_a (RenderInfo *info)
if (++y == ye) if (++y == ye)
break; break;
info->dest += info->dest_bpl; info->dest += info->dest_bpl;
info->dy += info->y_dest_inc; info->dy += info->y_dest_inc;
info->src_y += info->dy / info->y_src_dec; info->src_y += info->dy / info->y_src_dec;