blob: 354a4b323f413c16965208f1ab76b85648334d03 [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",
Fedor Kudasov90df0562019-06-19 11:41:34 +0100244 "LightingInfo.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100245 "ProfileData.cpp",
246 "ProfileDataContainer.cpp",
247 "Readback.cpp",
248 "RecordingCanvas.cpp",
249 "RenderNode.cpp",
250 "RenderProperties.cpp",
251 "TreeInfo.cpp",
252 "WebViewFunctorManager.cpp",
253 "protos/graphicsstats.proto",
254 ],
255
256 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
257 cflags: ["-Wno-implicit-fallthrough"],
258 },
259 host: {
260 export_static_lib_headers: [
261 "libarect",
262 ],
263 }
264 }
Colin Crossf6298102017-04-19 15:25:25 -0700265}
266
267cc_library {
268 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100269 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700270 defaults: [
271 "libhwui_defaults",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700272 ],
Colin Crossf6298102017-04-19 15:25:25 -0700273}
274
Colin Crossf6298102017-04-19 15:25:25 -0700275cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700276 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700277 defaults: [
278 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700279 ],
Colin Crossf6298102017-04-19 15:25:25 -0700280}
281
282cc_defaults {
283 name: "hwui_test_defaults",
284 defaults: ["hwui_defaults"],
285 test_suites: ["device-tests"],
286 srcs: [
287 "tests/common/scenes/*.cpp",
288 "tests/common/LeakChecker.cpp",
289 "tests/common/TestListViewSceneBase.cpp",
290 "tests/common/TestContext.cpp",
291 "tests/common/TestScene.cpp",
292 "tests/common/TestUtils.cpp",
293 ],
294}
295
296// ------------------------
297// unit tests
298// ------------------------
299
300cc_test {
301 name: "hwui_unit_tests",
302 defaults: ["hwui_test_defaults"],
303
304 static_libs: [
305 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700306 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700307 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800308 shared_libs: [
309 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800310 ],
Colin Crossf6298102017-04-19 15:25:25 -0700311
312 srcs: [
313 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400314 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700316 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/DamageAccumulatorTests.cpp",
318 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700320 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/GraphicsStatsServiceTests.cpp",
322 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700323 "tests/unit/LinearAllocatorTests.cpp",
324 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700325 "tests/unit/PathInterpolatorTests.cpp",
326 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700327 "tests/unit/RenderNodeTests.cpp",
328 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800329 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400330 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/SkiaBehaviorTests.cpp",
332 "tests/unit/SkiaDisplayListTests.cpp",
333 "tests/unit/SkiaPipelineTests.cpp",
334 "tests/unit/SkiaRenderPropertiesTests.cpp",
335 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700336 "tests/unit/StringUtilsTests.cpp",
337 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700338 "tests/unit/ThreadBaseTests.cpp",
339 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700340 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400341 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800342 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700343 ],
344}
345
346// ------------------------
347// Macro-bench app
348// ------------------------
349
350cc_benchmark {
351 name: "hwuimacro",
352 defaults: ["hwui_test_defaults"],
353
John Reck23462d82019-05-29 16:55:06 -0700354 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800355 shared_libs: [
356 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800357 ],
Colin Crossf6298102017-04-19 15:25:25 -0700358
359 srcs: [
360 "tests/macrobench/TestSceneRunner.cpp",
361 "tests/macrobench/main.cpp",
362 ],
363}
364
365// ------------------------
366// Micro-bench app
367// ---------------------
368
369cc_benchmark {
370 name: "hwuimicro",
371 defaults: ["hwui_test_defaults"],
372
John Reck23462d82019-05-29 16:55:06 -0700373 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800374 shared_libs: [
375 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800376 ],
Colin Crossf6298102017-04-19 15:25:25 -0700377
378 srcs: [
379 "tests/microbench/main.cpp",
380 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700381 "tests/microbench/LinearAllocatorBench.cpp",
382 "tests/microbench/PathParserBench.cpp",
383 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700384 ],
385}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800386
387// ----------------------------------------
388// Phony target to build benchmarks for PGO
389// ----------------------------------------
390
391phony {
392 name: "pgo-targets-hwui",
393 required: [
394 "hwuimicro",
395 "hwuimacro",
396 ]
397}