Skip to content

Commit

Permalink
Revert "DEBUG nitpicker_gfx: iterate orig version 10000 times"
Browse files Browse the repository at this point in the history
This reverts commit a25b19c1add29180bbb2d22c1bd8d951b1a7895e.
  • Loading branch information
nfeske committed Jan 28, 2025
1 parent 973a33e commit 554f460
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions repos/os/include/nitpicker_gfx/texture_painter.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,12 @@ struct Texture_painter
/*
* Copy texture with alpha blending
*/
{
auto iteration = [&] (auto src, auto alpha, auto dst)
{
for (j = clipped.h(); j--; src += src_w, alpha += src_w, dst += dst_w)
for (i = clipped.w(), s = src, a = alpha, d = dst; i--; s++, d++, a++) {
unsigned char const alpha_value = *a;
if (__builtin_expect(alpha_value != 0, true))
*d = PT::mix(*d, *s, alpha_value + 1);
}
};
for (unsigned k = 0; k < 10000; k++)
iteration(src, alpha, dst);
}

for (j = clipped.h(); j--; src += src_w, alpha += src_w, dst += dst_w)
for (i = clipped.w(), s = src, a = alpha, d = dst; i--; s++, d++, a++) {
unsigned char const alpha_value = *a;
if (__builtin_expect(alpha_value != 0, true))
*d = PT::mix(*d, *s, alpha_value + 1);
}
break;

case MIXED:
Expand Down

0 comments on commit 554f460

Please sign in to comment.