blob: 82bcf9e9afa4cb46d8e950df4f1af1a076fc3132 [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08005 "skia_deps",
Colin Crossf6298102017-04-19 15:25:25 -07006 //"hwui_bugreport_font_cache_usage",
7 //"hwui_compile_for_perf",
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -08008 "hwui_pgo",
Pirama Arumuga Nainarb7913e12018-03-09 00:03:57 +00009 "hwui_lto",
Colin Crossf6298102017-04-19 15:25:25 -070010 ],
11
John Reck283bb462018-12-13 16:40:14 -080012 cpp_std: "experimental",
13
Colin Crossf6298102017-04-19 15:25:25 -070014 cflags: [
15 "-DEGL_EGLEXT_PROTOTYPES",
16 "-DGL_GLEXT_PROTOTYPES",
17 "-DATRACE_TAG=ATRACE_TAG_VIEW",
18 "-DLOG_TAG=\"OpenGLRenderer\"",
19 "-Wall",
20 "-Wno-unused-parameter",
21 "-Wunreachable-code",
22 "-Werror",
23 "-fvisibility=hidden",
24
25 // GCC false-positives on this warning, and since we -Werror that's
26 // a problem
27 "-Wno-free-nonheap-object",
28
29 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
30 "-Wno-missing-braces",
Colin Crossf6298102017-04-19 15:25:25 -070031 ],
32
33 include_dirs: [
34 "external/skia/include/private",
35 "external/skia/src/core",
Colin Crossf6298102017-04-19 15:25:25 -070036 ],
37
38 product_variables: {
John Reck27294182018-07-11 11:21:09 -070039 eng: {
40 lto: {
41 never: true,
42 },
43 },
Colin Crossf6298102017-04-19 15:25:25 -070044 },
Fedor Kudasov182cbf92019-06-05 10:30:20 +010045
46 target: {
47 android: {
48 include_dirs: [
49 "external/skia/src/effects",
50 "external/skia/src/image",
51 "external/skia/src/utils",
52 "external/skia/src/gpu",
53 "external/skia/src/shaders",
54 ],
55 },
56 host: {
57 include_dirs: [
58 "external/vulkan-headers/include",
59 ],
60 cflags: [
61 "-Wno-unused-variable",
62 ],
63 }
64 }
Colin Crossf6298102017-04-19 15:25:25 -070065}
66
67cc_defaults {
68 name: "hwui_static_deps",
69 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010070 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -070071 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -070072 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -070073 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +010074
75 target: {
76 android: {
77 shared_libs: [
78 "liblog",
79 "libcutils",
80 "libstatslog",
81 "libutils",
82 "libEGL",
83 "libGLESv1_CM",
84 "libGLESv2",
85 "libGLESv3",
86 "libvulkan",
87 "libui",
88 "libgui",
89 "libprotobuf-cpp-lite",
90 "libft2",
91 "libandroidfw",
92 "libcrypto",
93 "libsync",
94 ],
95 static_libs: [
96 "libEGL_blobCache",
97 ],
98 },
99 host: {
100 static_libs: [
101 "libandroidfw",
102 "libutils",
103 ],
104 }
105 }
Colin Crossf6298102017-04-19 15:25:25 -0700106}
107
108cc_defaults {
109 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700110 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
111}
112
113cc_defaults {
114 name: "hwui_compile_for_perf",
115 // TODO: Non-arm?
116 cflags: [
117 "-fno-omit-frame-pointer",
118 "-marm",
119 "-mapcs",
120 ],
121}
122
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800123// Build libhwui with PGO by default.
124// Location of PGO profile data is defined in build/soong/cc/pgo.go
125// and is separate from hwui.
126// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
127// or set enable_profile_use property to false.
128cc_defaults {
129 name: "hwui_pgo",
130
131 pgo: {
132 instrumentation: true,
133 profile_file: "hwui/hwui.profdata",
134 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800135 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800136 },
137}
138
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800139// Build hwui library with ThinLTO by default.
140cc_defaults {
141 name: "hwui_lto",
142 target: {
143 android: {
144 lto: {
145 thin: true,
146 },
147 },
148 },
149}
150
Colin Crossf6298102017-04-19 15:25:25 -0700151// ------------------------
152// library
153// ------------------------
154
155cc_defaults {
156 name: "libhwui_defaults",
157 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400158
159 whole_static_libs: ["libskia"],
160
Colin Crossf6298102017-04-19 15:25:25 -0700161 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500162 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500163 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700164 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700165 "hwui/Canvas.cpp",
166 "hwui/MinikinSkia.cpp",
167 "hwui/MinikinUtils.cpp",
168 "hwui/PaintImpl.cpp",
169 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700170 "utils/Blur.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700171 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700172 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700173 "Animator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700174 "Interpolator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700175 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700176 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700177 "Properties.cpp",
178 "PropertyValuesAnimatorSet.cpp",
179 "PropertyValuesHolder.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700181 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 ],
183
Kweku Adams228b6d22018-04-12 13:09:04 -0700184 proto: {
185 export_proto_headers: true,
186 },
187
Colin Crossf6298102017-04-19 15:25:25 -0700188 export_include_dirs: ["."],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100189
190 target: {
191 android: {
192
193 srcs: [
194 "pipeline/skia/GLFunctorDrawable.cpp",
195 "pipeline/skia/LayerDrawable.cpp",
196 "pipeline/skia/RenderNodeDrawable.cpp",
197 "pipeline/skia/ReorderBarrierDrawables.cpp",
198 "pipeline/skia/ShaderCache.cpp",
199 "pipeline/skia/SkiaDisplayList.cpp",
200 "pipeline/skia/SkiaMemoryTracer.cpp",
201 "pipeline/skia/SkiaOpenGLPipeline.cpp",
202 "pipeline/skia/SkiaPipeline.cpp",
203 "pipeline/skia/SkiaProfileRenderer.cpp",
204 "pipeline/skia/SkiaRecordingCanvas.cpp",
205 "pipeline/skia/SkiaVulkanPipeline.cpp",
206 "pipeline/skia/VectorDrawableAtlas.cpp",
207 "pipeline/skia/VkFunctorDrawable.cpp",
208 "pipeline/skia/VkInteropFunctorDrawable.cpp",
209 "renderstate/RenderState.cpp",
210 "renderthread/CacheManager.cpp",
211 "renderthread/CanvasContext.cpp",
212 "renderthread/DrawFrameTask.cpp",
213 "renderthread/EglManager.cpp",
214 "renderthread/ReliableSurface.cpp",
215 "renderthread/VulkanManager.cpp",
216 "renderthread/VulkanSurface.cpp",
217 "renderthread/RenderProxy.cpp",
218 "renderthread/RenderTask.cpp",
219 "renderthread/RenderThread.cpp",
220 "renderthread/TimeLord.cpp",
221 "renderthread/Frame.cpp",
222 "service/GraphicsStatsService.cpp",
223 "surfacetexture/EGLConsumer.cpp",
224 "surfacetexture/ImageConsumer.cpp",
225 "surfacetexture/SurfaceTexture.cpp",
226 "thread/CommonPool.cpp",
227 "utils/Color.cpp",
228 "utils/GLUtils.cpp",
229 "utils/StringUtils.cpp",
230 "AnimationContext.cpp",
231 "AnimatorManager.cpp",
232 "CanvasTransform.cpp",
233 "DamageAccumulator.cpp",
234 "DeferredLayerUpdater.cpp",
235 "DeviceInfo.cpp",
236 "FrameInfo.cpp",
237 "FrameInfoVisualizer.cpp",
238 "GpuMemoryTracker.cpp",
239 "HardwareBitmapUploader.cpp",
240 "HWUIProperties.sysprop",
241 "JankTracker.cpp",
242 "Layer.cpp",
243 "LayerUpdateQueue.cpp",
244 "ProfileData.cpp",
245 "ProfileDataContainer.cpp",
246 "Readback.cpp",
247 "RecordingCanvas.cpp",
248 "RenderNode.cpp",
249 "RenderProperties.cpp",
250 "TreeInfo.cpp",
251 "WebViewFunctorManager.cpp",
252 "protos/graphicsstats.proto",
253 ],
254
255 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
256 cflags: ["-Wno-implicit-fallthrough"],
257 },
258 host: {
259 export_static_lib_headers: [
260 "libarect",
261 ],
262 }
263 }
Colin Crossf6298102017-04-19 15:25:25 -0700264}
265
266cc_library {
267 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100268 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700269 defaults: [
270 "libhwui_defaults",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700271 ],
Colin Crossf6298102017-04-19 15:25:25 -0700272}
273
Colin Crossf6298102017-04-19 15:25:25 -0700274cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700275 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700276 defaults: [
277 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700278 ],
Colin Crossf6298102017-04-19 15:25:25 -0700279}
280
281cc_defaults {
282 name: "hwui_test_defaults",
283 defaults: ["hwui_defaults"],
284 test_suites: ["device-tests"],
285 srcs: [
286 "tests/common/scenes/*.cpp",
287 "tests/common/LeakChecker.cpp",
288 "tests/common/TestListViewSceneBase.cpp",
289 "tests/common/TestContext.cpp",
290 "tests/common/TestScene.cpp",
291 "tests/common/TestUtils.cpp",
292 ],
293}
294
295// ------------------------
296// unit tests
297// ------------------------
298
299cc_test {
300 name: "hwui_unit_tests",
301 defaults: ["hwui_test_defaults"],
302
303 static_libs: [
304 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700305 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700306 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800307 shared_libs: [
308 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800309 ],
Colin Crossf6298102017-04-19 15:25:25 -0700310
311 srcs: [
312 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400313 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700314 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700315 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700316 "tests/unit/DamageAccumulatorTests.cpp",
317 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700318 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700320 "tests/unit/GraphicsStatsServiceTests.cpp",
321 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700322 "tests/unit/LinearAllocatorTests.cpp",
323 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700324 "tests/unit/PathInterpolatorTests.cpp",
325 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700326 "tests/unit/RenderNodeTests.cpp",
327 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800328 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400329 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700330 "tests/unit/SkiaBehaviorTests.cpp",
331 "tests/unit/SkiaDisplayListTests.cpp",
332 "tests/unit/SkiaPipelineTests.cpp",
333 "tests/unit/SkiaRenderPropertiesTests.cpp",
334 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700335 "tests/unit/StringUtilsTests.cpp",
336 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700337 "tests/unit/ThreadBaseTests.cpp",
338 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700339 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400340 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800341 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700342 ],
343}
344
345// ------------------------
346// Macro-bench app
347// ------------------------
348
349cc_benchmark {
350 name: "hwuimacro",
351 defaults: ["hwui_test_defaults"],
352
John Reck23462d82019-05-29 16:55:06 -0700353 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800354 shared_libs: [
355 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800356 ],
Colin Crossf6298102017-04-19 15:25:25 -0700357
358 srcs: [
359 "tests/macrobench/TestSceneRunner.cpp",
360 "tests/macrobench/main.cpp",
361 ],
362}
363
364// ------------------------
365// Micro-bench app
366// ---------------------
367
368cc_benchmark {
369 name: "hwuimicro",
370 defaults: ["hwui_test_defaults"],
371
John Reck23462d82019-05-29 16:55:06 -0700372 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800373 shared_libs: [
374 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800375 ],
Colin Crossf6298102017-04-19 15:25:25 -0700376
377 srcs: [
378 "tests/microbench/main.cpp",
379 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700380 "tests/microbench/LinearAllocatorBench.cpp",
381 "tests/microbench/PathParserBench.cpp",
382 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700383 ],
384}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800385
386// ----------------------------------------
387// Phony target to build benchmarks for PGO
388// ----------------------------------------
389
390phony {
391 name: "pgo-targets-hwui",
392 required: [
393 "hwuimicro",
394 "hwuimacro",
395 ]
396}