Fixed a preserve-transparency bug w/blend tool and possibly elsewhere.

Sun May 23 02:35:57 BST 1999  Adam D. Moss  <adam@gimp.org>

	* app/paint_funcs.c: Fixed a preserve-transparency
	bug w/blend tool and possibly elsewhere.  Allowed
	the opacity-quickskip rule to be applied more generously.

	Be a bit lazier with row-hint re-evalution (tnx j).
This commit is contained in:
BST 1999 Adam D. Moss 1999-05-23 01:46:08 +00:00 committed by Adam D. Moss
parent dcfb450b25
commit d15f16deb4
3 changed files with 54 additions and 18 deletions

View File

@ -1,3 +1,11 @@
Sun May 23 02:35:57 BST 1999 Adam D. Moss <adam@gimp.org>
* app/paint_funcs.c: Fixed a preserve-transparency
bug w/blend tool and possibly elsewhere. Allowed
the opacity-quickskip rule to be applied more generously.
Be a bit lazier with row-hint re-evalution (tnx j).
1999-05-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/[all files with resolution info]

View File

@ -5148,14 +5148,19 @@ combine_sub_region(struct combine_regions_struct *st,
/* cheap and easy when the row of src2 is completely opaque/transparent */
opacity_quickskip_possible = ((!m) && (opacity==255));
transparency_quickskip_possible = ((src2->tiles) && (mode != REPLACE_MODE));
opacity_quickskip_possible = ((!m) && (opacity==255) &&
(mode_affect &&
has_alpha1 &&
affect[src1->bytes-1]));
transparency_quickskip_possible = ((src2->tiles) &&
(mode != REPLACE_MODE));
if (src1->w > 128)
g_error("combine_sub_region::src1->w = %d\n", src1->w);
if (src2->tiles)
if ((transparency_quickskip_possible || opacity_quickskip_possible) &&
src2->tiles)
{
#ifdef HINTS_SANITY
if (src1->h != src2->h)
@ -5172,13 +5177,23 @@ combine_sub_region(struct combine_regions_struct *st,
{
hint = TILEROWHINT_UNDEFINED;
if (transparency_quickskip_possible &&
((hint = tile_get_rowhint (src2->curtile, (src2->offy + h))) ==
TILEROWHINT_TRANSPARENT))
if (transparency_quickskip_possible)
{
goto next_row;
hint = tile_get_rowhint (src2->curtile, (src2->offy + h));
if (hint == TILEROWHINT_TRANSPARENT)
{
goto next_row;
}
}
else
{
if (opacity_quickskip_possible)
{
hint = tile_get_rowhint (src2->curtile, (src2->offy + h));
}
}
s = buf;
/* apply the paint mode based on the combination type & mode */
@ -5211,7 +5226,6 @@ combine_sub_region(struct combine_regions_struct *st,
break;
}
/* based on the type of the initial image... */
switch (combine)
{

View File

@ -5148,14 +5148,19 @@ combine_sub_region(struct combine_regions_struct *st,
/* cheap and easy when the row of src2 is completely opaque/transparent */
opacity_quickskip_possible = ((!m) && (opacity==255));
transparency_quickskip_possible = ((src2->tiles) && (mode != REPLACE_MODE));
opacity_quickskip_possible = ((!m) && (opacity==255) &&
(mode_affect &&
has_alpha1 &&
affect[src1->bytes-1]));
transparency_quickskip_possible = ((src2->tiles) &&
(mode != REPLACE_MODE));
if (src1->w > 128)
g_error("combine_sub_region::src1->w = %d\n", src1->w);
if (src2->tiles)
if ((transparency_quickskip_possible || opacity_quickskip_possible) &&
src2->tiles)
{
#ifdef HINTS_SANITY
if (src1->h != src2->h)
@ -5172,13 +5177,23 @@ combine_sub_region(struct combine_regions_struct *st,
{
hint = TILEROWHINT_UNDEFINED;
if (transparency_quickskip_possible &&
((hint = tile_get_rowhint (src2->curtile, (src2->offy + h))) ==
TILEROWHINT_TRANSPARENT))
if (transparency_quickskip_possible)
{
goto next_row;
hint = tile_get_rowhint (src2->curtile, (src2->offy + h));
if (hint == TILEROWHINT_TRANSPARENT)
{
goto next_row;
}
}
else
{
if (opacity_quickskip_possible)
{
hint = tile_get_rowhint (src2->curtile, (src2->offy + h));
}
}
s = buf;
/* apply the paint mode based on the combination type & mode */
@ -5211,7 +5226,6 @@ combine_sub_region(struct combine_regions_struct *st,
break;
}
/* based on the type of the initial image... */
switch (combine)
{