Skip to content

Commit

Permalink
ifdef and comment out libjpeg
Browse files Browse the repository at this point in the history
Chances are there are not many themes in widespread use that are
using jpeg images, but this will be easy to revert back or even
just temporarily modify if we need jpeg support in a pinch.

Change-Id: If17b05ce3ebccce724fd74b26ed8ea91b287c3cf
  • Loading branch information
Dees-Troy committed Jan 27, 2016
1 parent fbb4353 commit e95c486
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 18 deletions.
3 changes: 1 addition & 2 deletions gui/theme/landscape_hdpi/splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<resolution width="1920" height="1200"/>
<author>TeamWin</author>
<title>TWRP</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<description>splash screen</description>
<themeversion>1</themeversion>
</details>

Expand Down
2 changes: 1 addition & 1 deletion gui/theme/landscape_hdpi/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<author>TeamWin</author>
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<preview>preview.png</preview>
<themeversion>1</themeversion>
</details>

Expand Down
3 changes: 1 addition & 2 deletions gui/theme/landscape_mdpi/splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<resolution width="800" height="480"/>
<author>TeamWin</author>
<title>TWRP</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<description>splash screen</description>
<themeversion>1</themeversion>
</details>

Expand Down
2 changes: 1 addition & 1 deletion gui/theme/landscape_mdpi/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<author>TeamWin</author>
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<preview>preview.png</preview>
<themeversion>1</themeversion>
</details>

Expand Down
3 changes: 1 addition & 2 deletions gui/theme/portrait_hdpi/splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<resolution width="1080" height="1920"/>
<author>TeamWin</author>
<title>TWRP</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<description>splash screen</description>
<themeversion>1</themeversion>
</details>

Expand Down
2 changes: 1 addition & 1 deletion gui/theme/portrait_hdpi/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<author>TeamWin</author>
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<preview>preview.png</preview>
<themeversion>1</themeversion>
</details>

Expand Down
3 changes: 1 addition & 2 deletions gui/theme/portrait_mdpi/splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<resolution width="480" height="800"/>
<author>TeamWin</author>
<title>TWRP</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<description>splash screen</description>
<themeversion>1</themeversion>
</details>

Expand Down
2 changes: 1 addition & 1 deletion gui/theme/portrait_mdpi/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<author>TeamWin</author>
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<preview>preview.png</preview>
<themeversion>1</themeversion>
</details>

Expand Down
3 changes: 1 addition & 2 deletions gui/theme/watch_mdpi/splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<resolution width="320" height="320"/>
<author>TeamWin</author>
<title>TWRP</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<description>splash screen</description>
<themeversion>1</themeversion>
</details>

Expand Down
2 changes: 1 addition & 1 deletion gui/theme/watch_mdpi/ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<author>TeamWin</author>
<title>Backup Naowz</title>
<description>Default basic theme</description>
<preview>preview.jpg</preview>
<preview>preview.png</preview>
<themeversion>1</themeversion>
</details>

Expand Down
6 changes: 4 additions & 2 deletions minuitwrp/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ LOCAL_C_INCLUDES += \
external/libpng \
external/zlib \
system/core/include \
external/jpeg \
external/freetype/include \
external/libcxx/include

#external/jpeg \
ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
endif
Expand Down Expand Up @@ -151,7 +152,8 @@ endif
LOCAL_CLANG := true

LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libjpeg libpng libutils
LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils
#libjpeg
LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := libminuitwrp
Expand Down
8 changes: 8 additions & 0 deletions minuitwrp/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include <png.h>

#include <pixelflinger/pixelflinger.h>
#ifdef TW_INCLUDE_JPEG
extern "C" {
#include "jpeglib.h"
}
#endif
#include "minui.h"

#define SURFACE_DATA_ALIGNMENT 8
Expand Down Expand Up @@ -251,6 +253,7 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) {
return result;
}

#ifdef TW_INCLUDE_JPEG
int res_create_surface_jpg(const char* name, gr_surface* pSurface) {
GGLSurface* surface = NULL;
int result = 0, y;
Expand Down Expand Up @@ -348,18 +351,23 @@ int res_create_surface_jpg(const char* name, gr_surface* pSurface) {
}
return result;
}
#endif

int res_create_surface(const char* name, gr_surface* pSurface) {
int ret;

if (!name) return -1;

#ifdef TW_INCLUDE_JPEG
if (strlen(name) > 4 && strcmp(name + strlen(name) - 4, ".jpg") == 0)
return res_create_surface_jpg(name,pSurface);
#endif

ret = res_create_surface_png(name,pSurface);
#ifdef TW_INCLUDE_JPEG
if (ret < 0)
ret = res_create_surface_jpg(name,pSurface);
#endif

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion prebuilt/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libext4_utils.so
endif
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libaosprecovery.so
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
#RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libjpeg.so
ifeq ($(TWHAVE_SELINUX), true)
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libselinux.so
ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
Expand Down

0 comments on commit e95c486

Please sign in to comment.