зеркало из https://github.com/mozilla/pjs.git
Bug 19283 - blacken transparent pixels in 1-bit masks. This was
causing problems with binary alpha PNGs on Windows. Patch from Chris244@aol.com. r=pnunn, sr=tor
This commit is contained in:
Родитель
ee4e28fb11
Коммит
beb95ef65f
|
@ -408,6 +408,7 @@ il_alpha_mask(
|
|||
int tmprand=0;
|
||||
tmprand = 1+(int)(200.0*rand()/(RAND_MAX+1.0));
|
||||
not_transparent = (*(src+3) > tmprand);
|
||||
if(!not_transparent) { *src = 0; src[1] = 0; src[2] = 0; }
|
||||
|
||||
SHIFT_IMAGE_MASK(not_transparent);
|
||||
n += src_len;
|
||||
|
@ -428,7 +429,7 @@ il_alpha_mask(
|
|||
while (n >= src_len) {
|
||||
tmprand = 1+(int)(200.0*rand()/(RAND_MAX+1.0));
|
||||
not_transparent = (*(src+3) > tmprand);
|
||||
|
||||
if(!not_transparent) { *src = 0; src[1] = 0; src[2] = 0; }
|
||||
SHIFT_IMAGE_MASK(not_transparent);
|
||||
n -= src_len;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче