blob: eaade34a1db632c5b7a52ce6bc40b7b90e5c31b4 [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 Reckd2e72142015-08-17 13:11:43 -07005hwui_src_files := \
6 font/CacheTexture.cpp \
7 font/Font.cpp \
8 renderstate/Blend.cpp \
9 renderstate/MeshState.cpp \
10 renderstate/PixelBufferState.cpp \
11 renderstate/RenderState.cpp \
12 renderstate/Scissor.cpp \
13 renderstate/Stencil.cpp \
14 renderstate/TextureState.cpp \
15 renderthread/CanvasContext.cpp \
16 renderthread/DrawFrameTask.cpp \
17 renderthread/EglManager.cpp \
18 renderthread/RenderProxy.cpp \
19 renderthread/RenderTask.cpp \
20 renderthread/RenderThread.cpp \
21 renderthread/TimeLord.cpp \
22 thread/TaskManager.cpp \
23 utils/Blur.cpp \
24 utils/GLUtils.cpp \
25 utils/LinearAllocator.cpp \
Derek Sollenberger4c5efe92015-07-10 13:56:39 -040026 utils/NinePatchImpl.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -070027 utils/StringUtils.cpp \
John Reckd2e72142015-08-17 13:11:43 -070028 AmbientShadow.cpp \
29 AnimationContext.cpp \
30 Animator.cpp \
31 AnimatorManager.cpp \
32 AssetAtlas.cpp \
33 Caches.cpp \
34 CanvasState.cpp \
35 ClipArea.cpp \
36 DamageAccumulator.cpp \
37 DeferredDisplayList.cpp \
38 DeferredLayerUpdater.cpp \
39 DisplayList.cpp \
40 DisplayListCanvas.cpp \
41 Dither.cpp \
42 Extensions.cpp \
43 FboCache.cpp \
44 FontRenderer.cpp \
45 FrameInfo.cpp \
46 FrameInfoVisualizer.cpp \
47 GammaFontRenderer.cpp \
48 GlopBuilder.cpp \
49 GradientCache.cpp \
50 Image.cpp \
51 Interpolator.cpp \
52 JankTracker.cpp \
53 Layer.cpp \
54 LayerCache.cpp \
55 LayerRenderer.cpp \
56 Matrix.cpp \
57 OpenGLRenderer.cpp \
58 Patch.cpp \
59 PatchCache.cpp \
60 PathCache.cpp \
61 PathTessellator.cpp \
62 PixelBuffer.cpp \
63 Program.cpp \
64 ProgramCache.cpp \
65 Properties.cpp \
66 RenderBufferCache.cpp \
67 RenderNode.cpp \
68 RenderProperties.cpp \
69 ResourceCache.cpp \
70 ShadowTessellator.cpp \
71 SkiaCanvas.cpp \
72 SkiaCanvasProxy.cpp \
73 SkiaShader.cpp \
74 Snapshot.cpp \
75 SpotShadow.cpp \
76 TessellationCache.cpp \
77 TextDropShadowCache.cpp \
78 Texture.cpp \
John Recke248bd12015-08-05 13:53:53 -070079 TextureCache.cpp \
80 protos/hwui.proto
John Reckd2e72142015-08-17 13:11:43 -070081
82hwui_cflags := \
83 -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
84 -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
85 -Wall -Wno-unused-parameter -Wunreachable-code \
86 -ffast-math -O3 -Werror
87
88ifndef HWUI_COMPILE_SYMBOLS
89 hwui_cflags += -fvisibility=hidden
90endif
91
92ifdef HWUI_COMPILE_FOR_PERF
93 # TODO: Non-arm?
94 hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
95endif
96
John Recke248bd12015-08-05 13:53:53 -070097# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
98# which varies depending on what is being built
99define hwui_proto_include
100$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
101endef
102
John Reckd2e72142015-08-17 13:11:43 -0700103hwui_c_includes += \
104 external/skia/src/core
105
106hwui_shared_libraries := \
107 liblog \
108 libcutils \
109 libutils \
110 libEGL \
111 libGLESv2 \
112 libskia \
113 libui \
114 libgui \
John Recke248bd12015-08-05 13:53:53 -0700115 libprotobuf-cpp-lite \
John Reckd2e72142015-08-17 13:11:43 -0700116
117ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
118 hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
119 hwui_shared_libraries += libRS libRScpp
120 hwui_c_includes += \
121 $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
122 frameworks/rs/cpp \
123 frameworks/rs
124endif
125
126
127# ------------------------
128# static library
129# ------------------------
130
131include $(CLEAR_VARS)
132
133LOCAL_MODULE_CLASS := STATIC_LIBRARIES
134LOCAL_MODULE := libhwui_static
135LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
136LOCAL_CFLAGS := $(hwui_cflags)
137LOCAL_SRC_FILES := $(hwui_src_files)
John Recke248bd12015-08-05 13:53:53 -0700138LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
139LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
John Reckd2e72142015-08-17 13:11:43 -0700140
141include $(BUILD_STATIC_LIBRARY)
142
143# ------------------------
144# shared library
145# ------------------------
146
147include $(CLEAR_VARS)
148
John Recka2732a22014-12-18 13:52:33 -0800149LOCAL_MODULE_CLASS := SHARED_LIBRARIES
150LOCAL_MODULE := libhwui
John Reckd2e72142015-08-17 13:11:43 -0700151LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
152LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
Romain Guye4d01122010-06-16 18:44:05 -0700153
John Recka2732a22014-12-18 13:52:33 -0800154include $(BUILD_SHARED_LIBRARY)
Andreas Gampeedaecc12014-11-10 20:54:07 -0800155
John Reckd2e72142015-08-17 13:11:43 -0700156# ------------------------
157# unit tests
158# ------------------------
159
160include $(CLEAR_VARS)
161
162LOCAL_MODULE := hwui_unit_tests
163LOCAL_MODULE_TAGS := tests
164LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
165LOCAL_STATIC_LIBRARIES := libhwui_static
John Reckd2e72142015-08-17 13:11:43 -0700166LOCAL_CFLAGS := $(hwui_cflags)
167
168LOCAL_SRC_FILES += \
Chris Craik95571062015-09-02 12:55:52 -0700169 unit_tests/CanvasStateTests.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700170 unit_tests/ClipAreaTests.cpp \
171 unit_tests/DamageAccumulatorTests.cpp \
Chris Craik6e6646c2015-09-14 15:54:12 -0700172 unit_tests/LinearAllocatorTests.cpp \
173 unit_tests/StringUtilsTests.cpp
John Reckd2e72142015-08-17 13:11:43 -0700174
175include $(BUILD_NATIVE_TEST)
176
177# ------------------------
178# test app
179# ------------------------
180
181include $(CLEAR_VARS)
182
183LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
184LOCAL_MODULE:= hwuitest
185LOCAL_MODULE_TAGS := tests
John Recke248bd12015-08-05 13:53:53 -0700186LOCAL_MODULE_CLASS := EXECUTABLES
John Reckd2e72142015-08-17 13:11:43 -0700187LOCAL_MULTILIB := both
188LOCAL_MODULE_STEM_32 := hwuitest
189LOCAL_MODULE_STEM_64 := hwuitest64
190LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
191LOCAL_CFLAGS := $(hwui_cflags)
John Reckd2e72142015-08-17 13:11:43 -0700192
193HWUI_NULL_GPU := false
194
195ifeq (true, $(HWUI_NULL_GPU))
John Recke248bd12015-08-05 13:53:53 -0700196 # Only need to specify the includes if we are not linking against
197 # libhwui_static as libhwui_static exports the appropriate includes
198 LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
199
John Reckd2e72142015-08-17 13:11:43 -0700200 LOCAL_SRC_FILES := \
201 $(hwui_src_files) \
202 tests/nullegl.cpp \
203 tests/nullgles.cpp
204
205 LOCAL_CFLAGS += -DHWUI_NULL_GPU
206else
207 LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
208endif
209
210LOCAL_SRC_FILES += \
211 tests/TestContext.cpp \
John Recke702c9c2015-10-07 10:26:02 -0700212 tests/TreeContentAnimation.cpp \
John Reckd2e72142015-08-17 13:11:43 -0700213 tests/main.cpp
214
215include $(BUILD_EXECUTABLE)