blob: 2ca2091e1a6cb9d30f61a952e61a1e57f9bbce09 [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),)
Ethan Yonkerabf1fb02019-04-24 16:09:07 -050024 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
25 LOCAL_REQUIRED_MODULES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
26 else
27 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
28 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060029 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
30 else
Kra1o50024e382014-12-17 01:49:00 +010031 ifeq ($(TARGET_CUSTOM_KERNEL_HEADERS),)
Greg Wallace62c188c2016-01-27 18:12:05 -050032 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Kra1o50024e382014-12-17 01:49:00 +010033 else
34 LOCAL_C_INCLUDES += $(TARGET_CUSTOM_KERNEL_HEADERS)
35 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060036 endif
37else
Greg Wallace62c188c2016-01-27 18:12:05 -050038 LOCAL_C_INCLUDES += $(commands_recovery_local_path)/minuitwrp/include
Ethan Yonkerfbb43532015-12-28 21:54:50 +010039 # The header files required for adf graphics can cause compile errors
40 # with adf graphics.
Ethan Yonker2f685272018-10-19 08:06:03 -050041 ifneq ($(wildcard system/core/adf/Android.*),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010042 LOCAL_CFLAGS += -DHAS_ADF
43 LOCAL_SRC_FILES += graphics_adf.cpp
44 LOCAL_WHOLE_STATIC_LIBRARIES += libadf
45 endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -060046endif
47
Kra1o5de50c5f2015-04-23 21:46:36 +020048ifeq ($(TW_NEW_ION_HEAP), true)
49 LOCAL_CFLAGS += -DNEW_ION_HEAP
50endif
51
lambdadroidd842fe12018-09-26 22:30:16 +020052ifneq ($(wildcard external/libdrm/Android.*),)
Ethan Yonkerfbb43532015-12-28 21:54:50 +010053 LOCAL_CFLAGS += -DHAS_DRM
54 LOCAL_SRC_FILES += graphics_drm.cpp
Ethan Yonker3eb70ed2018-01-04 08:59:36 -060055 ifneq ($(wildcard external/libdrm/Android.common.mk),)
56 LOCAL_WHOLE_STATIC_LIBRARIES += libdrm_platform
57 else
58 LOCAL_WHOLE_STATIC_LIBRARIES += libdrm
59 endif
Ethan Yonkerfbb43532015-12-28 21:54:50 +010060endif
61
Dees_Troy2673cec2013-04-02 20:22:16 +000062LOCAL_C_INCLUDES += \
63 external/libpng \
64 external/zlib \
Dees_Troy930bf012013-08-10 22:19:03 +000065 system/core/include \
Ethan Yonkerfbb43532015-12-28 21:54:50 +010066 external/freetype/include \
67 external/libcxx/include
Dees_Troy51a0e822012-09-05 15:24:24 -040068
Greg Wallaceace76232016-01-27 17:15:51 -050069ifneq ($(TW_INCLUDE_JPEG),)
70 LOCAL_C_INCLUDES += \
71 external/jpeg
72 LOCAL_CFLAGS += -DTW_INCLUDE_JPEG
73endif
Ethan Yonkere95c4862016-01-27 10:57:26 -060074
Dees_Troy51a0e822012-09-05 15:24:24 -040075ifeq ($(RECOVERY_TOUCHSCREEN_SWAP_XY), true)
76LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_SWAP_XY
77endif
78
79ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_X), true)
80LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_X
81endif
82
83ifeq ($(RECOVERY_TOUCHSCREEN_FLIP_Y), true)
84LOCAL_CFLAGS += -DRECOVERY_TOUCHSCREEN_FLIP_Y
85endif
86
Ethan Yonker31f855b2016-01-28 22:31:48 -060087ifeq ($(RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH), true)
88LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_USE_LINELENGTH
Dees_Troy51a0e822012-09-05 15:24:24 -040089endif
90
Ethan Yonker4a71d4f2016-07-29 17:42:36 -050091ifeq ($(RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER), true)
92LOCAL_CFLAGS += -DRECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER
Kra1o5c9556cc2015-06-24 12:19:09 +020093endif
94
Dees_Troy51a0e822012-09-05 15:24:24 -040095#Remove the # from the line below to enable event logging
96#TWRP_EVENT_LOGGING := true
97ifeq ($(TWRP_EVENT_LOGGING), true)
98LOCAL_CFLAGS += -D_EVENT_LOGGING
99endif
100
Ethan Yonker31f855b2016-01-28 22:31:48 -0600101ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBA_8888)
102 $(warning ****************************************************************************)
103 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBA_8888 not implemented yet *)
104 $(warning ****************************************************************************)
105 $(error stopping)
Kra1o577568592015-10-14 18:09:54 +0200106 LOCAL_CFLAGS += -DRECOVERY_RGBA
107endif
Ethan Yonker31f855b2016-01-28 22:31:48 -0600108ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGBX_8888)
109 $(warning ****************************************************************************)
110 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := RGBX_8888 not implemented yet *)
111 $(warning ****************************************************************************)
112 $(error stopping)
113 LOCAL_CFLAGS += -DRECOVERY_RGBX
114endif
115ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),BGRA_8888)
116 $(warning ****************************************************************************)
117 $(warning * TARGET_RECOVERY_FORCE_PIXEL_FORMAT := BGRA_8888 not implemented yet *)
118 $(warning ****************************************************************************)
119 $(error stopping)
120 LOCAL_CFLAGS += -DRECOVERY_BGRA
121endif
122ifeq ($(subst ",,$(TARGET_RECOVERY_FORCE_PIXEL_FORMAT)),RGB_565)
123 LOCAL_CFLAGS += -DRECOVERY_FORCE_RGB_565
124endif
125
126# This used to compare against values in double-quotes (which are just
127# ordinary characters in this context). Strip double-quotes from the
128# value so that either will work.
129
130ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),ABGR_8888)
131 LOCAL_CFLAGS += -DRECOVERY_ABGR
132endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600133ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
134 LOCAL_CFLAGS += -DRECOVERY_RGBX
135endif
136ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),BGRA_8888)
137 LOCAL_CFLAGS += -DRECOVERY_BGRA
138endif
Ethan Yonker4ee5ad72014-02-18 18:41:17 -0600139
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100140ifneq ($(TARGET_RECOVERY_OVERSCAN_PERCENT),)
141 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=$(TARGET_RECOVERY_OVERSCAN_PERCENT)
142else
143 LOCAL_CFLAGS += -DOVERSCAN_PERCENT=0
144endif
xNUTxcd56f8c2014-07-23 01:30:20 +0200145ifeq ($(TW_SCREEN_BLANK_ON_BOOT), true)
146 LOCAL_CFLAGS += -DTW_SCREEN_BLANK_ON_BOOT
147endif
Muhammad Fahad Baig0ac22932016-04-07 09:19:33 +0100148ifeq ($(TW_FBIOPAN), true)
149 LOCAL_CFLAGS += -DTW_FBIOPAN
150endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400151
Vladimir Olteand32b7eb2018-07-03 00:04:03 +0300152ifneq ($(TW_ROTATION),)
153 ifeq (,$(filter 0 90 180 270, $(TW_ROTATION)))
154 $(error TW_ROTATION must be set to 0, 90, 180 or 270. Currently set to $(TW_ROTATION))
155 endif
156 LOCAL_CFLAGS += -DTW_ROTATION=$(TW_ROTATION)
157else
158 # Support for old flag
159 ifeq ($(BOARD_HAS_FLIPPED_SCREEN), true)
160 LOCAL_CFLAGS += -DTW_ROTATION=180
161 else
162 LOCAL_CFLAGS += -DTW_ROTATION=0
163 endif
Dees_Troy51a0e822012-09-05 15:24:24 -0400164endif
165
Ibrahim Awwal2e9cb012014-01-04 12:38:26 -0800166ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
167LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
168endif
169
Ethan Yonker32f68a32014-12-29 08:13:23 -0600170ifeq ($(TW_IGNORE_MT_POSITION_0), true)
171LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
172endif
173
Ethan Yonkerd6821a12015-08-26 15:29:23 -0500174ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
175LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
176endif
177
Ethan Yonker5742a402014-08-12 14:52:49 -0500178ifneq ($(TW_INPUT_BLACKLIST),)
179 LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
180endif
181
Flemmardf4674612014-01-10 09:14:44 +0100182ifneq ($(TW_WHITELIST_INPUT),)
183 LOCAL_CFLAGS += -DWHITELIST_INPUT=$(TW_WHITELIST_INPUT)
184endif
185
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200186ifeq ($(TW_DISABLE_TTF), true)
Ethan Yonker88037f42015-10-04 22:09:08 -0500187 $(warning ****************************************************************************)
188 $(warning * TW_DISABLE_TTF support has been deprecated in TWRP. *)
189 $(warning ****************************************************************************)
190 $(error stopping)
Vojtech Bocek76ee9032014-09-07 15:01:56 +0200191endif
192
Ethan Yonkerfbb43532015-12-28 21:54:50 +0100193LOCAL_CLANG := true
194
Dees Troy3454ade2015-01-20 19:21:04 +0000195LOCAL_CFLAGS += -DTWRES=\"$(TWRES_PATH)\"
Dees Troy9a4d7402019-03-21 14:17:28 -0400196LOCAL_SHARED_LIBRARIES += libft2 libz libc libcutils libpng libutils libc++
Greg Wallaceace76232016-01-27 17:15:51 -0500197ifneq ($(TW_INCLUDE_JPEG),)
198 LOCAL_SHARED_LIBRARIES += libjpeg
199endif
Ethan Yonkerc798c9c2015-10-09 11:15:26 -0500200LOCAL_STATIC_LIBRARIES += libpixelflinger_twrp
Ethan Yonker8373cfe2017-09-08 06:50:54 -0500201ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 25; echo $$?),0)
202LOCAL_SHARED_LIBRARIES += libcutils liblog libutils
203endif
Dees_Troy2673cec2013-04-02 20:22:16 +0000204LOCAL_MODULE_TAGS := eng
Dees_Troy51a0e822012-09-05 15:24:24 -0400205LOCAL_MODULE := libminuitwrp
206
Dees_Troy930bf012013-08-10 22:19:03 +0000207include $(BUILD_SHARED_LIBRARY)