blob: 11d92721e1e028d007eb82a073be789bb6d83a91 [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",
36 "external/skia/src/effects",
37 "external/skia/src/image",
38 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040039 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040040 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070041 ],
42
43 product_variables: {
John Reck27294182018-07-11 11:21:09 -070044 eng: {
45 lto: {
46 never: true,
47 },
48 },
Colin Crossf6298102017-04-19 15:25:25 -070049 },
50}
51
52cc_defaults {
53 name: "hwui_static_deps",
54 shared_libs: [
55 "liblog",
56 "libcutils",
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010057 "libbase",
Yangster-macba5bf0d2018-10-09 20:48:23 -070058 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070059 "libutils",
60 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010061 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070062 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010063 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070064 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070065 "libui",
66 "libgui",
John Reck915883b2017-05-03 10:27:20 -070067 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070068 "libharfbuzz_ng",
69 "libft2",
70 "libminikin",
71 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080072 "libcrypto",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -050073 "libsync",
Colin Crossf6298102017-04-19 15:25:25 -070074 ],
75 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040076 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070077 ],
78}
79
80cc_defaults {
81 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070082 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
83}
84
85cc_defaults {
86 name: "hwui_compile_for_perf",
87 // TODO: Non-arm?
88 cflags: [
89 "-fno-omit-frame-pointer",
90 "-marm",
91 "-mapcs",
92 ],
93}
94
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -080095// Build libhwui with PGO by default.
96// Location of PGO profile data is defined in build/soong/cc/pgo.go
97// and is separate from hwui.
98// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
99// or set enable_profile_use property to false.
100cc_defaults {
101 name: "hwui_pgo",
102
103 pgo: {
104 instrumentation: true,
105 profile_file: "hwui/hwui.profdata",
106 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800107 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800108 },
109}
110
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800111// Build hwui library with ThinLTO by default.
112cc_defaults {
113 name: "hwui_lto",
114 target: {
115 android: {
116 lto: {
117 thin: true,
118 },
119 },
120 },
121}
122
Colin Crossf6298102017-04-19 15:25:25 -0700123// ------------------------
124// library
125// ------------------------
126
127cc_defaults {
128 name: "libhwui_defaults",
129 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400130
131 whole_static_libs: ["libskia"],
132
Colin Crossf6298102017-04-19 15:25:25 -0700133 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500134 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500135 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700136 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700137 "hwui/Canvas.cpp",
138 "hwui/MinikinSkia.cpp",
139 "hwui/MinikinUtils.cpp",
140 "hwui/PaintImpl.cpp",
141 "hwui/Typeface.cpp",
142 "pipeline/skia/GLFunctorDrawable.cpp",
143 "pipeline/skia/LayerDrawable.cpp",
144 "pipeline/skia/RenderNodeDrawable.cpp",
145 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400146 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700147 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400148 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700149 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700150 "pipeline/skia/SkiaPipeline.cpp",
151 "pipeline/skia/SkiaProfileRenderer.cpp",
152 "pipeline/skia/SkiaRecordingCanvas.cpp",
153 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400154 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800155 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800156 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700157 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400158 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700159 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700160 "renderthread/DrawFrameTask.cpp",
161 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800162 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700163 "renderthread/VulkanManager.cpp",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -0500164 "renderthread/VulkanSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700165 "renderthread/RenderProxy.cpp",
166 "renderthread/RenderTask.cpp",
167 "renderthread/RenderThread.cpp",
168 "renderthread/TimeLord.cpp",
169 "renderthread/Frame.cpp",
170 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000171 "surfacetexture/EGLConsumer.cpp",
172 "surfacetexture/ImageConsumer.cpp",
173 "surfacetexture/SurfaceTexture.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700174 "thread/CommonPool.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700175 "utils/Blur.cpp",
176 "utils/Color.cpp",
177 "utils/GLUtils.cpp",
178 "utils/LinearAllocator.cpp",
179 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700181 "AnimationContext.cpp",
182 "Animator.cpp",
183 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700184 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700185 "DamageAccumulator.cpp",
186 "DeferredLayerUpdater.cpp",
187 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700188 "FrameInfo.cpp",
189 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700190 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700191 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500192 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700193 "Interpolator.cpp",
194 "JankTracker.cpp",
195 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700196 "LayerUpdateQueue.cpp",
197 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700198 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700199 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700200 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700201 "Properties.cpp",
202 "PropertyValuesAnimatorSet.cpp",
203 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400204 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700205 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700206 "RenderNode.cpp",
207 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700208 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700209 "TreeInfo.cpp",
John Reck283bb462018-12-13 16:40:14 -0800210 "WebViewFunctorManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700211 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700212 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700213 ],
214
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700215 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
216 cflags: ["-Wno-implicit-fallthrough"],
217
Kweku Adams228b6d22018-04-12 13:09:04 -0700218 proto: {
219 export_proto_headers: true,
220 },
221
Colin Crossf6298102017-04-19 15:25:25 -0700222 export_include_dirs: ["."],
223}
224
225cc_library {
226 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700227 defaults: [
228 "libhwui_defaults",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700229 ],
Colin Crossf6298102017-04-19 15:25:25 -0700230}
231
Colin Crossf6298102017-04-19 15:25:25 -0700232cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700233 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700234 defaults: [
235 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700236 ],
Colin Crossf6298102017-04-19 15:25:25 -0700237}
238
239cc_defaults {
240 name: "hwui_test_defaults",
241 defaults: ["hwui_defaults"],
242 test_suites: ["device-tests"],
243 srcs: [
244 "tests/common/scenes/*.cpp",
245 "tests/common/LeakChecker.cpp",
246 "tests/common/TestListViewSceneBase.cpp",
247 "tests/common/TestContext.cpp",
248 "tests/common/TestScene.cpp",
249 "tests/common/TestUtils.cpp",
250 ],
251}
252
253// ------------------------
254// unit tests
255// ------------------------
256
257cc_test {
258 name: "hwui_unit_tests",
259 defaults: ["hwui_test_defaults"],
260
261 static_libs: [
262 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700263 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700264 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800265 shared_libs: [
266 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800267 ],
Colin Crossf6298102017-04-19 15:25:25 -0700268
269 srcs: [
270 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400271 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700272 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700273 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700274 "tests/unit/DamageAccumulatorTests.cpp",
275 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700276 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700277 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700278 "tests/unit/GraphicsStatsServiceTests.cpp",
279 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700280 "tests/unit/LinearAllocatorTests.cpp",
281 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700282 "tests/unit/PathInterpolatorTests.cpp",
283 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700284 "tests/unit/RenderNodeTests.cpp",
285 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800286 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400287 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700288 "tests/unit/SkiaBehaviorTests.cpp",
289 "tests/unit/SkiaDisplayListTests.cpp",
290 "tests/unit/SkiaPipelineTests.cpp",
291 "tests/unit/SkiaRenderPropertiesTests.cpp",
292 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700293 "tests/unit/StringUtilsTests.cpp",
294 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700295 "tests/unit/ThreadBaseTests.cpp",
296 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700297 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400298 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800299 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700300 ],
301}
302
303// ------------------------
304// Macro-bench app
305// ------------------------
306
307cc_benchmark {
308 name: "hwuimacro",
309 defaults: ["hwui_test_defaults"],
310
John Reck23462d82019-05-29 16:55:06 -0700311 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800312 shared_libs: [
313 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800314 ],
Colin Crossf6298102017-04-19 15:25:25 -0700315
316 srcs: [
317 "tests/macrobench/TestSceneRunner.cpp",
318 "tests/macrobench/main.cpp",
319 ],
320}
321
322// ------------------------
323// Micro-bench app
324// ---------------------
325
326cc_benchmark {
327 name: "hwuimicro",
328 defaults: ["hwui_test_defaults"],
329
John Reck23462d82019-05-29 16:55:06 -0700330 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800331 shared_libs: [
332 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800333 ],
Colin Crossf6298102017-04-19 15:25:25 -0700334
335 srcs: [
336 "tests/microbench/main.cpp",
337 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700338 "tests/microbench/LinearAllocatorBench.cpp",
339 "tests/microbench/PathParserBench.cpp",
340 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700341 ],
342}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800343
344// ----------------------------------------
345// Phony target to build benchmarks for PGO
346// ----------------------------------------
347
348phony {
349 name: "pgo-targets-hwui",
350 required: [
351 "hwuimicro",
352 "hwuimacro",
353 ]
354}