blob: d94c91d64572dabbe5b8d4b543698df06a060380 [file] [log] [blame]
Romain Guye4d01122010-06-16 18:44:05 -07001LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
Dan Albert88ba3392014-09-11 16:20:16 -07003LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Romain Guye4d01122010-06-16 18:44:05 -07004
Chris Craikb565df12015-10-05 13:00:52 -07005HWUI_NEW_OPS := false
6
John Reckd2e72142015-08-17 13:11:43 -07007hwui_src_files := \
8 font/CacheTexture.cpp \
9 font/Font.cpp \
10 renderstate/Blend.cpp \
11 renderstate/MeshState.cpp \
12 renderstate/PixelBufferState.cpp \
13 renderstate/RenderState.cpp \
14 renderstate/Scissor.cpp \
15 renderstate/Stencil.cpp \
16 renderstate/TextureState.cpp \
17 renderthread/CanvasContext.cpp \
18 renderthread/DrawFrameTask.cpp \
19 renderthread/EglManager.cpp \
20 renderthread/RenderProxy.cpp \
21 renderthread/RenderTask.cpp \
22 renderthread/RenderThread.cpp \
23 renderthread/TimeLord.cpp \
24 thread/TaskManager.cpp \
25 utils/Blur.cpp \
26 utils/GLUtils.cpp \
27 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040028 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070029 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040030 utils/TestWindowContext.cpp \
John Reckd2e72142015-08-17 13:11:43 -070031 AmbientShadow.cpp \
32 AnimationContext.cpp \
33 Animator.cpp \
34 AnimatorManager.cpp \
35 AssetAtlas.cpp \
36 Caches.cpp \
37 CanvasState.cpp \
38 ClipArea.cpp \
39 DamageAccumulator.cpp \
40 DeferredDisplayList.cpp \
41 DeferredLayerUpdater.cpp \
42 DisplayList.cpp \
43 DisplayListCanvas.cpp \
44 Dither.cpp \
45 Extensions.cpp \
46 FboCache.cpp \
47 FontRenderer.cpp \
48 FrameInfo.cpp \
49 FrameInfoVisualizer.cpp \
50 GammaFontRenderer.cpp \
51 GlopBuilder.cpp \
52 GradientCache.cpp \
53 Image.cpp \
54 Interpolator.cpp \
55 JankTracker.cpp \
56 Layer.cpp \
57 LayerCache.cpp \
58 LayerRenderer.cpp \
59 Matrix.cpp \
60 OpenGLRenderer.cpp \
61 Patch.cpp \
62 PatchCache.cpp \
63 PathCache.cpp \
64 PathTessellator.cpp \
65 PixelBuffer.cpp \
66 Program.cpp \
67 ProgramCache.cpp \
68 Properties.cpp \
69 RenderBufferCache.cpp \
70 RenderNode.cpp \
71 RenderProperties.cpp \
72 ResourceCache.cpp \
73 ShadowTessellator.cpp \
74 SkiaCanvas.cpp \
75 SkiaCanvasProxy.cpp \
76 SkiaShader.cpp \
77 Snapshot.cpp \
78 SpotShadow.cpp \
79 TessellationCache.cpp \
80 TextDropShadowCache.cpp \
81 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -070082 TextureCache.cpp \
83 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070084
85hwui_cflags := \
86 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
87 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -070088 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -070089
Chris Craikb565df12015-10-05 13:00:52 -070090ifeq (true, $(HWUI_NEW_OPS))
91 hwui_src_files += \
92 BakedOpRenderer.cpp \
93 OpReorderer.cpp \
94 RecordingCanvas.cpp
95
96 hwui_cflags += -DHWUI_NEW_OPS
97
98endif
99
John Reckd2e72142015-08-17 13:11:43 -0700100ifndef HWUI_COMPILE_SYMBOLS
101 hwui_cflags += -fvisibility=hidden
102endif
103
104ifdef HWUI_COMPILE_FOR_PERF
105 # TODO: Non-arm?
106 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
107endif
108
John Recke248bd12015-08-05 13:53:53 -0700109# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
110# which varies depending on what is being built
111define hwui_proto_include
112$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
113endef
114
John Reckd2e72142015-08-17 13:11:43 -0700115hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400116 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700117 external/skia/src/core
118
119hwui_shared_libraries := \
120 liblog \
121 libcutils \
122 libutils \
123 libEGL \
124 libGLESv2 \
125 libskia \
126 libui \
127 libgui \
John Recke248bd12015-08-05 13:53:53 -0700128 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700129
130ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
131 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
132 hwui_shared_libraries += libRS libRScpp
133 hwui_c_includes += \
134 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
135 frameworks/rs/cpp \
136 frameworks/rs
137endif
138
139
140# ------------------------
141# static library
142# ------------------------
143
144include $(CLEAR_VARS)
145
146LOCAL_MODULE_CLASS := STATIC_LIBRARIES
147LOCAL_MODULE := libhwui_static
148LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
149LOCAL_CFLAGS := $(hwui_cflags)
150LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700151LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
152LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700153
154include $(BUILD_STATIC_LIBRARY)
155
156# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700157# static library null gpu
158# ------------------------
159
160include $(CLEAR_VARS)
161
162LOCAL_MODULE_CLASS := STATIC_LIBRARIES
163LOCAL_MODULE := libhwui_static_null_gpu
164LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
165LOCAL_CFLAGS := \
166 $(hwui_cflags) \
167 -DHWUI_NULL_GPU
168LOCAL_SRC_FILES := \
169 $(hwui_src_files) \
170 tests/nullegl.cpp \
171 tests/nullgles.cpp
172LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
173LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
174
175include $(BUILD_STATIC_LIBRARY)
176
177# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700178# shared library
179# ------------------------
180
181include $(CLEAR_VARS)
182
John Recka2732a22014-12-18 13:52:33 -0800183LOCAL_MODULE_CLASS := SHARED_LIBRARIES
184LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700185LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
186LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700187
John Recka2732a22014-12-18 13:52:33 -0800188include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800189
John Reckd2e72142015-08-17 13:11:43 -0700190# ------------------------
191# unit tests
192# ------------------------
193
194include $(CLEAR_VARS)
195
196LOCAL_MODULE := hwui_unit_tests
197LOCAL_MODULE_TAGS := tests
198LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700199LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reckd2e72142015-08-17 13:11:43 -0700200LOCAL_CFLAGS := $(hwui_cflags)
201
202LOCAL_SRC_FILES += \
Chris Craik95571062015-09-02 12:55:52 -0700203 unit_tests/CanvasStateTests.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700204 unit_tests/ClipAreaTests.cpp \
205 unit_tests/DamageAccumulatorTests.cpp \
Chris Craik76ace112015-10-29 12:46:19 -0700206 unit_tests/FatVectorTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700207 unit_tests/LinearAllocatorTests.cpp \
208 unit_tests/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700209
Chris Craikb565df12015-10-05 13:00:52 -0700210ifeq (true, $(HWUI_NEW_OPS))
211 LOCAL_SRC_FILES += \
212 unit_tests/BakedOpStateTests.cpp \
213 unit_tests/RecordingCanvasTests.cpp \
214 unit_tests/OpReordererTests.cpp
215endif
216
John Reckd2e72142015-08-17 13:11:43 -0700217include $(BUILD_NATIVE_TEST)
218
219# ------------------------
220# test app
221# ------------------------
222
223include $(CLEAR_VARS)
224
225LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
226LOCAL_MODULE:= hwuitest
227LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700228LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700229LOCAL_MULTILIB := both
230LOCAL_MODULE_STEM_32 := hwuitest
231LOCAL_MODULE_STEM_64 := hwuitest64
232LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
233LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700234
Chris Craik5fbd9db2015-10-19 11:22:11 -0700235# set to libhwui_static_null_gpu to skip actual GL commands
236LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700237
238LOCAL_SRC_FILES += \
239 tests/TestContext.cpp \
John Recke702c9c2015-10-07 10:26:02 -0700240 tests/TreeContentAnimation.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700241 tests/main.cpp
242
243include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700244
245# ------------------------
246# Micro-bench app
247# ---------------------
248include $(CLEAR_VARS)
249
250LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
251LOCAL_MODULE:= hwuimicro
252LOCAL_MODULE_TAGS := tests
253LOCAL_MODULE_CLASS := EXECUTABLES
254LOCAL_MULTILIB := both
255LOCAL_MODULE_STEM_32 := hwuimicro
256LOCAL_MODULE_STEM_64 := hwuimicro64
257LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
258LOCAL_CFLAGS := $(hwui_cflags)
259LOCAL_C_INCLUDES += bionic/benchmarks/
260
Chris Craik5fbd9db2015-10-19 11:22:11 -0700261LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700262LOCAL_STATIC_LIBRARIES := libbenchmark libbase
263
264LOCAL_SRC_FILES += \
Chris Craik81a1d2a2015-10-15 17:13:00 -0700265 microbench/DisplayListCanvasBench.cpp \
John Reck82f5e0c2015-10-22 17:07:45 -0700266 microbench/LinearAllocatorBench.cpp \
267 microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700268
Chris Craik0a24b142015-10-19 17:10:19 -0700269ifeq (true, $(HWUI_NEW_OPS))
270 LOCAL_SRC_FILES += \
271 microbench/OpReordererBench.cpp
272endif
273
John Reck4a4bc892015-10-12 07:38:22 -0700274include $(BUILD_EXECUTABLE)