blob: fc405541484f9da84ae6c5a5e955d442068a3c95 [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
John Reckdcdbba7c2016-01-19 13:57:16 -08005HWUI_NEW_OPS := true
Chris Craikb565df12015-10-05 13:00:52 -07006
John Reck975591a2016-01-22 16:28:07 -08007# Enables fine-grained GLES error checking
8# If set to true, every GLES call is wrapped & error checked
9# Has moderate overhead
10HWUI_ENABLE_OPENGL_VALIDATION := false
11
John Reckd2e72142015-08-17 13:11:43 -070012hwui_src_files := \
13 font/CacheTexture.cpp \
14 font/Font.cpp \
15 renderstate/Blend.cpp \
16 renderstate/MeshState.cpp \
Chris Craik9fded232015-11-11 16:42:34 -080017 renderstate/OffscreenBufferPool.cpp \
John Reckd2e72142015-08-17 13:11:43 -070018 renderstate/PixelBufferState.cpp \
19 renderstate/RenderState.cpp \
20 renderstate/Scissor.cpp \
21 renderstate/Stencil.cpp \
22 renderstate/TextureState.cpp \
23 renderthread/CanvasContext.cpp \
24 renderthread/DrawFrameTask.cpp \
25 renderthread/EglManager.cpp \
26 renderthread/RenderProxy.cpp \
27 renderthread/RenderTask.cpp \
28 renderthread/RenderThread.cpp \
29 renderthread/TimeLord.cpp \
30 thread/TaskManager.cpp \
31 utils/Blur.cpp \
32 utils/GLUtils.cpp \
33 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040034 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070035 utils/StringUtils.cpp \
Tom Hudsonb2f5bd22015-10-15 16:41:55 -040036 utils/TestWindowContext.cpp \
Doris Liu804618d2015-11-16 22:48:34 -080037 utils/VectorDrawableUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070038 AmbientShadow.cpp \
39 AnimationContext.cpp \
40 Animator.cpp \
41 AnimatorManager.cpp \
42 AssetAtlas.cpp \
43 Caches.cpp \
Chris Craika1717272015-11-19 13:02:43 -080044 Canvas.cpp \
John Reckd2e72142015-08-17 13:11:43 -070045 CanvasState.cpp \
46 ClipArea.cpp \
47 DamageAccumulator.cpp \
48 DeferredDisplayList.cpp \
49 DeferredLayerUpdater.cpp \
John Reck704bed02015-11-05 09:22:17 -080050 DeviceInfo.cpp \
John Reckd2e72142015-08-17 13:11:43 -070051 DisplayList.cpp \
52 DisplayListCanvas.cpp \
53 Dither.cpp \
54 Extensions.cpp \
55 FboCache.cpp \
56 FontRenderer.cpp \
57 FrameInfo.cpp \
58 FrameInfoVisualizer.cpp \
59 GammaFontRenderer.cpp \
60 GlopBuilder.cpp \
John Reck38e0c322015-11-10 12:19:17 -080061 GpuMemoryTracker.cpp \
John Reckd2e72142015-08-17 13:11:43 -070062 GradientCache.cpp \
63 Image.cpp \
64 Interpolator.cpp \
65 JankTracker.cpp \
66 Layer.cpp \
67 LayerCache.cpp \
68 LayerRenderer.cpp \
Chris Craik0b7e8242015-10-28 16:50:44 -070069 LayerUpdateQueue.cpp \
John Reckd2e72142015-08-17 13:11:43 -070070 Matrix.cpp \
71 OpenGLRenderer.cpp \
72 Patch.cpp \
73 PatchCache.cpp \
74 PathCache.cpp \
75 PathTessellator.cpp \
Doris Liu30bcf692015-11-04 14:56:24 -080076 PathParser.cpp \
John Reckd2e72142015-08-17 13:11:43 -070077 PixelBuffer.cpp \
78 Program.cpp \
79 ProgramCache.cpp \
80 Properties.cpp \
81 RenderBufferCache.cpp \
82 RenderNode.cpp \
83 RenderProperties.cpp \
84 ResourceCache.cpp \
85 ShadowTessellator.cpp \
86 SkiaCanvas.cpp \
87 SkiaCanvasProxy.cpp \
88 SkiaShader.cpp \
89 Snapshot.cpp \
90 SpotShadow.cpp \
91 TessellationCache.cpp \
92 TextDropShadowCache.cpp \
93 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -070094 TextureCache.cpp \
Doris Liu4bbc2932015-12-01 17:59:40 -080095 VectorDrawable.cpp \
John Recke248bd12015-08-05 13:53:53 -070096 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070097
Chris Craik8160f202015-12-02 14:50:25 -080098hwui_test_common_src_files := \
Chris Craik27e58b42015-12-07 10:01:38 -080099 $(call all-cpp-files-under, tests/common/scenes) \
100 tests/common/TestContext.cpp \
101 tests/common/TestScene.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800102 tests/common/TestUtils.cpp
103
John Reckd2e72142015-08-17 13:11:43 -0700104hwui_cflags := \
105 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
106 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
John Reck82f5e0c2015-10-22 17:07:45 -0700107 -Wall -Wno-unused-parameter -Wunreachable-code -Werror
John Reckd2e72142015-08-17 13:11:43 -0700108
John Reckc90ed752015-11-04 07:39:44 -0800109# GCC false-positives on this warning, and since we -Werror that's
110# a problem
111hwui_cflags += -Wno-free-nonheap-object
112
Chris Craikb565df12015-10-05 13:00:52 -0700113ifeq (true, $(HWUI_NEW_OPS))
114 hwui_src_files += \
Chris Craik9e7fcfd2015-11-25 13:27:33 -0800115 BakedOpDispatcher.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700116 BakedOpRenderer.cpp \
Chris Craike4db79d2015-12-22 16:32:23 -0800117 BakedOpState.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800118 FrameBuilder.cpp \
119 LayerBuilder.cpp \
Chris Craikb565df12015-10-05 13:00:52 -0700120 RecordingCanvas.cpp
121
122 hwui_cflags += -DHWUI_NEW_OPS
123
124endif
125
John Reckd2e72142015-08-17 13:11:43 -0700126ifndef HWUI_COMPILE_SYMBOLS
127 hwui_cflags += -fvisibility=hidden
128endif
129
130ifdef HWUI_COMPILE_FOR_PERF
131 # TODO: Non-arm?
132 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
133endif
134
John Recke248bd12015-08-05 13:53:53 -0700135# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
136# which varies depending on what is being built
137define hwui_proto_include
138$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
139endef
140
John Reckd2e72142015-08-17 13:11:43 -0700141hwui_c_includes += \
Leon Scroggins III55078072015-07-31 10:38:40 -0400142 external/skia/include/private \
John Reckd2e72142015-08-17 13:11:43 -0700143 external/skia/src/core
144
145hwui_shared_libraries := \
146 liblog \
147 libcutils \
148 libutils \
149 libEGL \
150 libGLESv2 \
151 libskia \
152 libui \
153 libgui \
John Recke248bd12015-08-05 13:53:53 -0700154 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700155
156ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
157 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
158 hwui_shared_libraries += libRS libRScpp
159 hwui_c_includes += \
160 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
161 frameworks/rs/cpp \
162 frameworks/rs
163endif
164
John Reck975591a2016-01-22 16:28:07 -0800165ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
166 hwui_cflags += -include debug/wrap_gles.h
167 hwui_src_files += debug/wrap_gles.cpp
168 hwui_c_includes += frameworks/native/opengl/libs/GLES2
169 hwui_cflags += -DDEBUG_OPENGL=3
170endif
171
John Reckd2e72142015-08-17 13:11:43 -0700172
173# ------------------------
174# static library
175# ------------------------
176
177include $(CLEAR_VARS)
178
179LOCAL_MODULE_CLASS := STATIC_LIBRARIES
180LOCAL_MODULE := libhwui_static
181LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
182LOCAL_CFLAGS := $(hwui_cflags)
183LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700184LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
185LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700186
187include $(BUILD_STATIC_LIBRARY)
188
189# ------------------------
Chris Craik5fbd9db2015-10-19 11:22:11 -0700190# static library null gpu
191# ------------------------
192
193include $(CLEAR_VARS)
194
195LOCAL_MODULE_CLASS := STATIC_LIBRARIES
196LOCAL_MODULE := libhwui_static_null_gpu
197LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
198LOCAL_CFLAGS := \
199 $(hwui_cflags) \
200 -DHWUI_NULL_GPU
201LOCAL_SRC_FILES := \
202 $(hwui_src_files) \
John Reck975591a2016-01-22 16:28:07 -0800203 debug/nullegl.cpp \
204 debug/nullgles.cpp
Chris Craik5fbd9db2015-10-19 11:22:11 -0700205LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
206LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
207
208include $(BUILD_STATIC_LIBRARY)
209
210# ------------------------
John Reckd2e72142015-08-17 13:11:43 -0700211# shared library
212# ------------------------
213
214include $(CLEAR_VARS)
215
John Recka2732a22014-12-18 13:52:33 -0800216LOCAL_MODULE_CLASS := SHARED_LIBRARIES
217LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700218LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
219LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700220
John Recka2732a22014-12-18 13:52:33 -0800221include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800222
John Reckd2e72142015-08-17 13:11:43 -0700223# ------------------------
224# unit tests
225# ------------------------
226
227include $(CLEAR_VARS)
228
229LOCAL_MODULE := hwui_unit_tests
230LOCAL_MODULE_TAGS := tests
231LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik5fbd9db2015-10-19 11:22:11 -0700232LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
Chris Craik98787e62015-11-13 10:55:30 -0800233LOCAL_CFLAGS := \
234 $(hwui_cflags) \
235 -DHWUI_NULL_GPU
John Reckd2e72142015-08-17 13:11:43 -0700236
237LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800238 $(hwui_test_common_src_files) \
239 tests/unit/CanvasStateTests.cpp \
240 tests/unit/ClipAreaTests.cpp \
John Recke5da4ef2016-01-14 12:34:46 -0800241 tests/unit/CrashHandlerInjector.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800242 tests/unit/DamageAccumulatorTests.cpp \
243 tests/unit/DeviceInfoTests.cpp \
244 tests/unit/FatVectorTests.cpp \
John Reck38e0c322015-11-10 12:19:17 -0800245 tests/unit/GpuMemoryTrackerTests.cpp \
Chris Craik8160f202015-12-02 14:50:25 -0800246 tests/unit/LayerUpdateQueueTests.cpp \
247 tests/unit/LinearAllocatorTests.cpp \
248 tests/unit/VectorDrawableTests.cpp \
249 tests/unit/OffscreenBufferPoolTests.cpp \
Andres Morales06f5bc72015-12-15 15:21:31 -0800250 tests/unit/StringUtilsTests.cpp \
251 tests/unit/BufferPoolTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700252
Chris Craikb565df12015-10-05 13:00:52 -0700253ifeq (true, $(HWUI_NEW_OPS))
254 LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800255 tests/unit/BakedOpStateTests.cpp \
Chris Craikf158b492016-01-12 14:45:08 -0800256 tests/unit/FrameBuilderTests.cpp \
John Reck1b94f9b2016-01-19 09:42:15 -0800257 tests/unit/LeakCheckTests.cpp \
Chris Craik5ea17242016-01-11 14:07:59 -0800258 tests/unit/RecordingCanvasTests.cpp
Chris Craikb565df12015-10-05 13:00:52 -0700259endif
260
John Reckd2e72142015-08-17 13:11:43 -0700261include $(BUILD_NATIVE_TEST)
262
263# ------------------------
Chris Craik8160f202015-12-02 14:50:25 -0800264# Macro-bench app
John Reckd2e72142015-08-17 13:11:43 -0700265# ------------------------
266
267include $(CLEAR_VARS)
268
269LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
270LOCAL_MODULE:= hwuitest
271LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700272LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700273LOCAL_MULTILIB := both
274LOCAL_MODULE_STEM_32 := hwuitest
275LOCAL_MODULE_STEM_64 := hwuitest64
276LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
277LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700278
Chris Craik5fbd9db2015-10-19 11:22:11 -0700279# set to libhwui_static_null_gpu to skip actual GL commands
280LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700281
282LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800283 $(hwui_test_common_src_files) \
Chris Craik8160f202015-12-02 14:50:25 -0800284 tests/macrobench/TestSceneRunner.cpp \
285 tests/macrobench/main.cpp
John Reckd2e72142015-08-17 13:11:43 -0700286
287include $(BUILD_EXECUTABLE)
John Reck4a4bc892015-10-12 07:38:22 -0700288
289# ------------------------
290# Micro-bench app
291# ---------------------
292include $(CLEAR_VARS)
293
294LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
295LOCAL_MODULE:= hwuimicro
296LOCAL_MODULE_TAGS := tests
297LOCAL_MODULE_CLASS := EXECUTABLES
298LOCAL_MULTILIB := both
299LOCAL_MODULE_STEM_32 := hwuimicro
300LOCAL_MODULE_STEM_64 := hwuimicro64
301LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Chris Craik8d1f2122015-11-24 16:40:09 -0800302LOCAL_CFLAGS := \
303 $(hwui_cflags) \
304 -DHWUI_NULL_GPU
John Reck4a4bc892015-10-12 07:38:22 -0700305LOCAL_C_INCLUDES += bionic/benchmarks/
306
Chris Craik5fbd9db2015-10-19 11:22:11 -0700307LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
John Reck4a4bc892015-10-12 07:38:22 -0700308LOCAL_STATIC_LIBRARIES := libbenchmark libbase
309
310LOCAL_SRC_FILES += \
Chris Craik8160f202015-12-02 14:50:25 -0800311 $(hwui_test_common_src_files) \
312 tests/microbench/DisplayListCanvasBench.cpp \
313 tests/microbench/LinearAllocatorBench.cpp \
314 tests/microbench/PathParserBench.cpp \
315 tests/microbench/ShadowBench.cpp
John Reck4a4bc892015-10-12 07:38:22 -0700316
John Reck7db5ffb2016-01-15 13:17:09 -0800317ifeq (true, $(HWUI_NEW_OPS))
318 LOCAL_SRC_FILES += \
319 tests/microbench/FrameBuilderBench.cpp
320endif
Chris Craik0a24b142015-10-19 17:10:19 -0700321
John Reck4a4bc892015-10-12 07:38:22 -0700322include $(BUILD_EXECUTABLE)