diff options
author | Doug Zongker <dougz@android.com> | 2011-03-08 00:47:04 +0100 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-08 00:47:04 +0100 |
commit | b70fe3f76a45f810bdf0934a151334d4343eb056 (patch) | |
tree | a117ef5e2cb4f6b0d380cb444784f73eaffd0403 | |
parent | Merge branch 'master' of ssh://android-git:29418/platform/bootable/recovery (diff) | |
parent | allow paletted RGB images in recovery (diff) | |
download | android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar.gz android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar.bz2 android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar.lz android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar.xz android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.tar.zst android_bootable_recovery-b70fe3f76a45f810bdf0934a151334d4343eb056.zip |
Diffstat (limited to '')
-rw-r--r-- | minui/resources.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/minui/resources.c b/minui/resources.c index 2170dca6a..b437a87cb 100644 --- a/minui/resources.c +++ b/minui/resources.c @@ -121,12 +121,17 @@ int res_create_surface(const char* name, gr_surface* pSurface) { surface->format = (channels == 3) ? GGL_PIXEL_FORMAT_RGBX_8888 : GGL_PIXEL_FORMAT_RGBA_8888; + int alpha = 0; if (color_type == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png_ptr); + png_set_palette_to_rgb(png_ptr); + } + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { + png_set_tRNS_to_alpha(png_ptr); + alpha = 1; } int y; - if (channels == 3) { + if (channels == 3 || (channels == 1 && !alpha)) { for (y = 0; y < height; ++y) { unsigned char* pRow = pData + y * stride; png_read_row(png_ptr, pRow, NULL); |