blob: 8565372f3b53e5064484a7bef53362fcb27ee18a [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 \
Chris Craik9fded232015-11-11 16:42:34 -080012 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070013 renderstate/PixelBufferState.cpp \
14 renderstate/RenderState.cpp \
15 renderstate/Scissor.cpp \
16 renderstate/Stencil.cpp \
17 renderstate/TextureState.cpp \
18 renderthread/CanvasContext.cpp \
19 renderthread/DrawFrameTask.cpp \
20 renderthread/EglManager.cpp \
21 renderthread/RenderProxy.cpp \
22 renderthread/RenderTask.cpp \
23 renderthread/RenderThread.cpp \
24 renderthread/TimeLord.cpp \
25 thread/TaskManager.cpp \
26 utils/Blur.cpp \
27 utils/GLUtils.cpp \
28 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040029 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070030 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040031 utils/TestWindowContext.cpp \
John Reckd2e72142015-08-17 13:11:43 -070032 AmbientShadow.cpp \
33 AnimationContext.cpp \
34 Animator.cpp \
35 AnimatorManager.cpp \
36 AssetAtlas.cpp \
37 Caches.cpp \
38 CanvasState.cpp \
39 ClipArea.cpp \
40 DamageAccumulator.cpp \
41 DeferredDisplayList.cpp \
42 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080043 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070044 DisplayList.cpp \
45 DisplayListCanvas.cpp \
46 Dither.cpp \
47 Extensions.cpp \
48 FboCache.cpp \
49 FontRenderer.cpp \
50 FrameInfo.cpp \
51 FrameInfoVisualizer.cpp \
52 GammaFontRenderer.cpp \
53 GlopBuilder.cpp \
54 GradientCache.cpp \
55 Image.cpp \
56 Interpolator.cpp \
57 JankTracker.cpp \
58 Layer.cpp \
59 LayerCache.cpp \
60 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070061 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070062 Matrix.cpp \
63 OpenGLRenderer.cpp \
64 Patch.cpp \
65 PatchCache.cpp \
66 PathCache.cpp \
67 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080068 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070069 PixelBuffer.cpp \
70 Program.cpp \
71 ProgramCache.cpp \
72 Properties.cpp \
73 RenderBufferCache.cpp \
74 RenderNode.cpp \
75 RenderProperties.cpp \
76 ResourceCache.cpp \
77 ShadowTessellator.cpp \
78 SkiaCanvas.cpp \
79 SkiaCanvasProxy.cpp \
80 SkiaShader.cpp \
81 Snapshot.cpp \
82 SpotShadow.cpp \
83 TessellationCache.cpp \
84 TextDropShadowCache.cpp \
85 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -070086 TextureCache.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080087 VectorDrawablePath.cpp \
John Recke248bd12015-08-05 13:53:53 -070088 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070089
90hwui_cflags := \
91 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
92 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -070093 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -070094
John Reckc90ed752015-11-04 07:39:44 -080095# GCC false-positives on this warning, and since we -Werror that's
96# a problem
97hwui_cflags += -Wno-free-nonheap-object
98
Chris Craikb565df12015-10-05 13:00:52 -070099ifeq (true, $(HWUI_NEW_OPS))
100 hwui_src_files += \
101 BakedOpRenderer.cpp \
102 OpReorderer.cpp \
103 RecordingCanvas.cpp
104
105 hwui_cflags += -DHWUI_NEW_OPS
106
107endif
108
John Reckd2e72142015-08-17 13:11:43 -0700109ifndef HWUI_COMPILE_SYMBOLS
110 hwui_cflags += -fvisibility=hidden
111endif
112
113ifdef HWUI_COMPILE_FOR_PERF
114 # TODO: Non-arm?
115 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
116endif
117
John Recke248bd12015-08-05 13:53:53 -0700118# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
119# which varies depending on what is being built
120define hwui_proto_include
121$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
122endef
123
John Reckd2e72142015-08-17 13:11:43 -0700124hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400125 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700126 external/skia/src/core
127
128hwui_shared_libraries := \
129 liblog \
130 libcutils \
131 libutils \
132 libEGL \
133 libGLESv2 \
134 libskia \
135 libui \
136 libgui \
John Recke248bd12015-08-05 13:53:53 -0700137 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700138
139ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
140 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
141 hwui_shared_libraries += libRS libRScpp
142 hwui_c_includes += \
143 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
144 frameworks/rs/cpp \
145 frameworks/rs
146endif
147
148
149# ------------------------
150# static library
151# ------------------------
152
153include $(CLEAR_VARS)
154
155LOCAL_MODULE_CLASS := STATIC_LIBRARIES
156LOCAL_MODULE := libhwui_static
157LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
158LOCAL_CFLAGS := $(hwui_cflags)
159LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700160LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
161LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700162
163include $(BUILD_STATIC_LIBRARY)
164
165# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700166# static library null gpu
167# ------------------------
168
169include $(CLEAR_VARS)
170
171LOCAL_MODULE_CLASS := STATIC_LIBRARIES
172LOCAL_MODULE := libhwui_static_null_gpu
173LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
174LOCAL_CFLAGS := \
175 $(hwui_cflags) \
176 -DHWUI_NULL_GPU
177LOCAL_SRC_FILES := \
178 $(hwui_src_files) \
179 tests/nullegl.cpp \
180 tests/nullgles.cpp
181LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
182LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
183
184include $(BUILD_STATIC_LIBRARY)
185
186# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700187# shared library
188# ------------------------
189
190include $(CLEAR_VARS)
191
John Recka2732a22014-12-18 13:52:33 -0800192LOCAL_MODULE_CLASS := SHARED_LIBRARIES
193LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700194LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
195LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700196
John Recka2732a22014-12-18 13:52:33 -0800197include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800198
John Reckd2e72142015-08-17 13:11:43 -0700199# ------------------------
200# unit tests
201# ------------------------
202
203include $(CLEAR_VARS)
204
205LOCAL_MODULE := hwui_unit_tests
206LOCAL_MODULE_TAGS := tests
207LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700208LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
Chris Craik98787e62015-11-13 10:55:30 -0800209LOCAL_CFLAGS := \
210 $(hwui_cflags) \
211 -DHWUI_NULL_GPU
John Reckd2e72142015-08-17 13:11:43 -0700212
213LOCAL_SRC_FILES += \
Chris Craik95571062015-09-02 12:55:52 -0700214 unit_tests/CanvasStateTests.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700215 unit_tests/ClipAreaTests.cpp \
216 unit_tests/DamageAccumulatorTests.cpp \
John Reck704bed02015-11-05 09:22:17 -0800217 unit_tests/DeviceInfoTests.cpp \
Chris Craik76ace112015-10-29 12:46:19 -0700218 unit_tests/FatVectorTests.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -0700219 unit_tests/LayerUpdateQueueTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700220 unit_tests/LinearAllocatorTests.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -0800221 unit_tests/PathParserTests.cpp \
Chris Craik9fded232015-11-11 16:42:34 -0800222 unit_tests/OffscreenBufferPoolTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700223 unit_tests/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700224
Chris Craikb565df12015-10-05 13:00:52 -0700225ifeq (true, $(HWUI_NEW_OPS))
226 LOCAL_SRC_FILES += \
227 unit_tests/BakedOpStateTests.cpp \
228 unit_tests/RecordingCanvasTests.cpp \
229 unit_tests/OpReordererTests.cpp
230endif
231
John Reckd2e72142015-08-17 13:11:43 -0700232include $(BUILD_NATIVE_TEST)
233
234# ------------------------
235# test app
236# ------------------------
237
238include $(CLEAR_VARS)
239
240LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
241LOCAL_MODULE:= hwuitest
242LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700243LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700244LOCAL_MULTILIB := both
245LOCAL_MODULE_STEM_32 := hwuitest
246LOCAL_MODULE_STEM_64 := hwuitest64
247LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
248LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700249
Chris Craik5fbd9db2015-10-19 11:22:11 -0700250# set to libhwui_static_null_gpu to skip actual GL commands
251LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700252
253LOCAL_SRC_FILES += \
254 tests/TestContext.cpp \
John Recke702c9c2015-10-07 10:26:02 -0700255 tests/TreeContentAnimation.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700256 tests/main.cpp
257
258include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700259
260# ------------------------
261# Micro-bench app
262# ---------------------
263include $(CLEAR_VARS)
264
265LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
266LOCAL_MODULE:= hwuimicro
267LOCAL_MODULE_TAGS := tests
268LOCAL_MODULE_CLASS := EXECUTABLES
269LOCAL_MULTILIB := both
270LOCAL_MODULE_STEM_32 := hwuimicro
271LOCAL_MODULE_STEM_64 := hwuimicro64
272LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
273LOCAL_CFLAGS := $(hwui_cflags)
274LOCAL_C_INCLUDES += bionic/benchmarks/
275
Chris Craik5fbd9db2015-10-19 11:22:11 -0700276LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700277LOCAL_STATIC_LIBRARIES := libbenchmark libbase
278
279LOCAL_SRC_FILES += \
Chris Craik81a1d2a2015-10-15 17:13:00 -0700280 microbench/DisplayListCanvasBench.cpp \
John Reck82f5e0c2015-10-22 17:07:45 -0700281 microbench/LinearAllocatorBench.cpp \
Doris Liuf59cb782015-11-10 10:36:17 -0800282 microbench/PathParserBench.cpp \
John Reck82f5e0c2015-10-22 17:07:45 -0700283 microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700284
Chris Craik0a24b142015-10-19 17:10:19 -0700285ifeq (true, $(HWUI_NEW_OPS))
286 LOCAL_SRC_FILES += \
287 microbench/OpReordererBench.cpp
288endif
289
John Reck4a4bc892015-10-12 07:38:22 -0700290include $(BUILD_EXECUTABLE)