blob: 3356402badbe0f14c20697b1f9f5465a40d45917 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH := $(call my-dir)
Dees_Troy2673cec2013-04-02 20:22:16 +00002
Dees_Troy51a0e822012-09-05 15:24:24 -04003include $(CLEAR_VARS)
4
Ethan Yonkerfbb43532015-12-28 21:54:50 +01005LOCAL_SRC_FILES := \
6 graphics.cpp \
7 graphics_fbdev.cpp \
8 resources.cpp \
Ethan Yonkerfbb43532015-12-28 21:54:50 +01009 truetype.cpp \
10 graphics_utils.cpp \
11 events.cpp
Dees_Troy86382ca2013-01-15 16:54:59 +000012
13ifneq ($(TW_BOARD_CUSTOM_GRAPHICS),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010014 $(warning ****************************************************************************)
15 $(warning * TW_BOARD_CUSTOM_GRAPHICS support has been deprecated in TWRP. *)
16 $(warning ****************************************************************************)
17 $(error stopping)
Dees_Troy86382ca2013-01-15 16:54:59 +000018endif
Dees_Troy51a0e822012-09-05 15:24:24 -040019
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060020ifeq ($(TW_TARGET_USES_QCOM_BSP), true)
21 LOCAL_CFLAGS += -DMSM_BSP
Ethan Yonkerb386f712017-01-20 14:30:28 -060022 LOCAL_SRC_FILES += graphics_overlay.cpp
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060023 ifeq ($(TARGET_PREBUILT_KERNEL),)
24 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
25 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
26 else
Kra1o50024e382014-12-17 01:49:00 +010027 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
Greg Wallace62c188c2016-01-27 18:12:05 -050028 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Kra1o50024e382014-12-17 01:49:00 +010029 else
30 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
31 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060032 endif
33else
Greg Wallace62c188c2016-01-27 18:12:05 -050034 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Ethan Yonkerfbb43532015-12-28 21:54:50 +010035 # The header files required for adf graphics can cause compile errors
36 # with adf graphics.
Ethan Yonker2f685272018-10-19 08:06:03 -050037 ifneq ($(wildcard system/core/adf/Android.*),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010038 LOCAL_CFLAGS += -DHAS_ADF
39 LOCAL_SRC_FILES += graphics_adf.cpp
40 LOCAL_WHOLE_STATIC_LIBRARIES += libadf
41 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060042endif
43
Kra1o5de50c5f2015-04-23 21:46:36 +020044ifeq ($(TW_NEW_ION_HEAP), true)
45 LOCAL_CFLAGS += -DNEW_ION_HEAP
46endif
47
lambdadroidd842fe12018-09-26 22:30:16 +020048ifneq ($(wildcard external/libdrm/Android.*),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010049 LOCAL_CFLAGS += -DHAS_DRM
50 LOCAL_SRC_FILES += graphics_drm.cpp
Ethan Yonker3eb70ed2018-01-04 08:59:36 -060051 ifneq ($(wildcard external/libdrm/Android.common.mk),)
52 LOCAL_WHOLE_STATIC_LIBRARIES += libdrm_platform
53 else
54 LOCAL_WHOLE_STATIC_LIBRARIES += libdrm
55 endif
Ethan Yonkerfbb43532015-12-28 21:54:50 +010056endif
57
Dees_Troy2673cec2013-04-02 20:22:16 +000058LOCAL_C_INCLUDES += \
59 external/libpng \
60 external/zlib \
Dees_Troy930bf012013-08-10 22:19:03 +000061 system/core/include \
Ethan Yonkerfbb43532015-12-28 21:54:50 +010062 external/freetype/include \
63 external/libcxx/include
Dees_Troy51a0e822012-09-05 15:24:24 -040064
Greg Wallaceace76232016-01-27 17:15:51 -050065ifneq ($(TW_INCLUDE_JPEG),)
66 LOCAL_C_INCLUDES += \
67 external/jpeg
68 LOCAL_CFLAGS += -DTW_INCLUDE_JPEG
69endif
Ethan Yonkere95c4862016-01-27 10:57:26 -060070
Dees_Troy51a0e822012-09-05 15:24:24 -040071ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
72LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
73endif
74
75ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true)
76LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X
77endif
78
79ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true)
80LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y
81endif
82
Ethan Yonker31f855b2016-01-28 22:31:48 -060083ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true)
84LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH
Dees_Troy51a0e822012-09-05 15:24:24 -040085endif
86
Ethan Yonker4a71d4f2016-07-29 17:42:36 -050087ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true)
88LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER
Kra1o5c9556cc2015-06-24 12:19:09 +020089endif
90
Dees_Troy51a0e822012-09-05 15:24:24 -040091#Remove the # from the line below to enable event logging
92#TWRP_EVENT_LOGGING := true
93ifeq ($(TWRP_EVENT_LOGGING), true)
94LOCAL_CFLAGS += -D_EVENT_LOGGING
95endif
96
Ethan Yonker31f855b2016-01-28 22:31:48 -060097ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888)
98 $(warning ****************************************************************************)
99 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *)
100 $(warning ****************************************************************************)
101 $(error stopping)
Kra1o577568592015-10-14 18:09:54 +0200102 LOCAL_CFLAGS += -DRECOVERY_RGBA
103endif
Ethan Yonker31f855b2016-01-28 22:31:48 -0600104ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888)
105 $(warning ****************************************************************************)
106 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *)
107 $(warning ****************************************************************************)
108 $(error stopping)
109 LOCAL_CFLAGS += -DRECOVERY_RGBX
110endif
111ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888)
112 $(warning ****************************************************************************)
113 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *)
114 $(warning ****************************************************************************)
115 $(error stopping)
116 LOCAL_CFLAGS += -DRECOVERY_BGRA
117endif
118ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565)
119 LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565
120endif
121
122# This used to compare against values in double-quotes (which are just
123# ordinary characters in this context). Strip double-quotes from the
124# value so that either will work.
125
126ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
127 LOCAL_CFLAGS += -DRECOVERY_ABGR
128endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600129ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
130 LOCAL_CFLAGS += -DRECOVERY_RGBX
131endif
132ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
133 LOCAL_CFLAGS += -DRECOVERY_BGRA
134endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600135
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100136ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
137 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
138else
139 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
140endif
xNUTxcd56f8c2014-07-23 01:30:20 +0200141ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
142 LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
143endif
Muhammad Fahad Baig0ac22932016-04-07 09:19:33 +0100144ifeq ($(TW_FBIOPAN), true)
145 LOCAL_CFLAGS += -DTW_FBIOPAN
146endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400147
Vladimir Olteand32b7eb2018-07-03 00:04:03 +0300148ifneq ($(TW_ROTATION),)
149 ifeq (,$(filter 0 90 180 270, $(TW_ROTATION)))
150 $(error TW_ROTATION must be set to 0, 90, 180 or 270. Currently set to $(TW_ROTATION))
151 endif
152 LOCAL_CFLAGS += -DTW_ROTATION=$(TW_ROTATION)
153else
154 # Support for old flag
155 ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true)
156 LOCAL_CFLAGS += -DTW_ROTATION=180
157 else
158 LOCAL_CFLAGS += -DTW_ROTATION=0
159 endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400160endif
161
Ibrahim Awwal2e9cb012014-01-04 12:38:26 -0800162ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
163LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
164endif
165
Ethan Yonker32f68a32014-12-29 08:13:23 -0600166ifeq ($(TW_IGNORE_MT_POSITION_0), true)
167LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
168endif
169
Ethan Yonkerd6821a12015-08-26 15:29:23 -0500170ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
171LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
172endif
173
Ethan Yonker5742a402014-08-12 14:52:49 -0500174ifneq ($(TW_INPUT_BLACKLIST),)
175 LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
176endif
177
Flemmardf4674612014-01-10 09:14:44 +0100178ifneq ($(TW_WHITELIST_INPUT),)
179 LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
180endif
181
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200182ifeq ($(TW_DISABLE_TTF), true)
Ethan Yonker88037f42015-10-04 22:09:08 -0500183 $(warning ****************************************************************************)
184 $(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *)
185 $(warning ****************************************************************************)
186 $(error stopping)
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200187endif
188
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100189LOCAL_CLANG := true
190
Dees Troy3454ade2015-01-20 19:21:04 +0000191LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
Dees Troy9a4d7402019-03-21 14:17:28 -0400192LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++
Greg Wallaceace76232016-01-27 17:15:51 -0500193ifneq ($(TW_INCLUDE_JPEG),)
194 LOCAL_SHARED_LIBRARIES += libjpeg
195endif
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500196LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500197ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
198LOCAL_SHARED_LIBRARIES += libcutils liblog libutils
199endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000200LOCAL_MODULE_TAGS := eng
Dees_Troy51a0e822012-09-05 15:24:24 -0400201LOCAL_MODULE := libminuitwrp
202
Dees_Troy930bf012013-08-10 22:19:03 +0000203include $(BUILD_SHARED_LIBRARY)