summaryrefslogtreecommitdiffstats
path: root/minui/resources.c
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2014-05-02 15:20:33 +0200
committerDees Troy <dees_troy@teamw.in>2014-05-02 18:51:52 +0200
commit62b75ab66a94ffef29d0568c4d54d63a02aff814 (patch)
tree0093cb06b3421f7e8a7fe0d482a1a9bc002261ae /minui/resources.c
parentrecovery: Compatibility with upstream minui change (diff)
downloadandroid_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar.gz
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar.bz2
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar.lz
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar.xz
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.tar.zst
android_bootable_recovery-62b75ab66a94ffef29d0568c4d54d63a02aff814.zip
Diffstat (limited to 'minui/resources.c')
-rw-r--r--minui/resources.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/minui/resources.c b/minui/resources.c
index c0a9ccacb..39f83c76f 100644
--- a/minui/resources.c
+++ b/minui/resources.c
@@ -33,7 +33,11 @@
#include "minui.h"
+#ifdef FASTMMI_FEATURE
+char *locale = NULL;
+#else
extern char* locale;
+#endif
// libpng gives "undefined reference to 'pow'" errors, and I have no
// idea how to convince the build system to link with -lm. We don't
@@ -93,13 +97,9 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
png_set_sig_bytes(png_ptr, sizeof(header));
png_read_info(png_ptr, info_ptr);
- int color_type, bit_depth;
- size_t width, height;
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
- &color_type, NULL, NULL, NULL);
-
- int channels = png_get_channels(png_ptr, info_ptr);
-
+ int color_type = info_ptr->color_type;
+ int bit_depth = info_ptr->bit_depth;
+ int channels = info_ptr->channels;
if (!(bit_depth == 8 &&
((channels == 3 && color_type == PNG_COLOR_TYPE_RGB) ||
(channels == 4 && color_type == PNG_COLOR_TYPE_RGBA) ||
@@ -109,6 +109,8 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
goto exit;
}
+ size_t width = info_ptr->width;
+ size_t height = info_ptr->height;
size_t stride = (color_type == PNG_COLOR_TYPE_GRAY ? 1 : 4) * width;
size_t pixelSize = stride * height;
@@ -248,11 +250,13 @@ int res_create_localized_surface(const char* name, gr_surface* pSurface) {
png_set_sig_bytes(png_ptr, sizeof(header));
png_read_info(png_ptr, info_ptr);
- int color_type, bit_depth;
- size_t width, height;
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
- &color_type, NULL, NULL, NULL);
- int channels = png_get_channels(png_ptr, info_ptr);
+ size_t width = info_ptr->width;
+ size_t height = info_ptr->height;
+ size_t stride = 4 * width;
+
+ int color_type = info_ptr->color_type;
+ int bit_depth = info_ptr->bit_depth;
+ int channels = info_ptr->channels;
if (!(bit_depth == 8 &&
(channels == 1 && color_type == PNG_COLOR_TYPE_GRAY))) {