Skip to content

Commit ef11af2

Browse files
authored
#2637 Revert to the previous alpha analysis to maintain legacy content parity. (#3061)
1 parent c2c468e commit ef11af2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

indra/llrender/llimagegl.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,15 +2179,15 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
21792179
// this will mid-skew the data (and thus increase the chances of not
21802180
// being used as a mask) from high-frequency alpha maps which
21812181
// suffer the worst from aliasing when used as alpha masks.
2182-
if (w >= 4 && h >= 4)
2182+
if (w >= 2 && h >= 2)
21832183
{
2184-
llassert(w%4 == 0);
2185-
llassert(h%4 == 0);
2184+
llassert(w % 2 == 0);
2185+
llassert(h % 2 == 0);
21862186
const GLubyte* rowstart = ((const GLubyte*) data_in) + mAlphaOffset;
2187-
for (U32 y = 0; y < h; y+=4)
2187+
for (U32 y = 0; y < h; y += 2)
21882188
{
21892189
const GLubyte* current = rowstart;
2190-
for (U32 x = 0; x < w; x+=4)
2190+
for (U32 x = 0; x < w; x += 2)
21912191
{
21922192
const U32 s1 = current[0];
21932193
alphatotal += s1;
@@ -2210,8 +2210,7 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
22102210
sample[asum/(16*4)] += 4;
22112211
}
22122212

2213-
2214-
rowstart += 4 * w * mAlphaStride;
2213+
rowstart += 2 * w * mAlphaStride;
22152214
}
22162215
length *= 2; // we sampled everything twice, essentially
22172216
}

0 commit comments

Comments
 (0)