mirror of https://github.com/axmolengine/axmol.git
ReFix bug: PremultipliedAlpha is not working for png (#19597)
This commit is contained in:
parent
ffcf627c13
commit
c3a0205652
|
@ -1044,9 +1044,18 @@ bool Image::initWithPngData(const unsigned char * data, ssize_t dataLen)
|
|||
png_read_end(png_ptr, nullptr);
|
||||
|
||||
// premultiplied alpha for RGBA8888
|
||||
if (PNG_PREMULTIPLIED_ALPHA_ENABLED && color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
if (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
premultipliedAlpha();
|
||||
if (PNG_PREMULTIPLIED_ALPHA_ENABLED)
|
||||
{
|
||||
premultipliedAlpha();
|
||||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_PREMULTIPLIED_ALPHA != 0
|
||||
_hasPremultipliedAlpha = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (row_pointers != nullptr)
|
||||
|
|
Loading…
Reference in New Issue