blob: b19aa2ff5862988451949df711e754a8dde15633 [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",
Fedor Kudasov86bd2142019-06-18 15:51:57 +010059 "frameworks/native/libs/math/include",
60 "frameworks/native/libs/ui/include",
Fedor Kudasov182cbf92019-06-05 10:30:20 +010061 ],
62 cflags: [
63 "-Wno-unused-variable",
64 ],
65 }
66 }
Colin Crossf6298102017-04-19 15:25:25 -070067}
68
69cc_defaults {
70 name: "hwui_static_deps",
71 shared_libs: [
Jerome Gaillarda02a12d2019-05-28 18:07:56 +010072 "libbase",
Colin Crossf6298102017-04-19 15:25:25 -070073 "libharfbuzz_ng",
Colin Crossf6298102017-04-19 15:25:25 -070074 "libminikin",
Colin Crossf6298102017-04-19 15:25:25 -070075 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +010076
77 target: {
78 android: {
79 shared_libs: [
80 "liblog",
81 "libcutils",
82 "libstatslog",
83 "libutils",
84 "libEGL",
85 "libGLESv1_CM",
86 "libGLESv2",
87 "libGLESv3",
88 "libvulkan",
89 "libui",
90 "libgui",
Alec Mouri22d753f2019-09-05 17:11:45 -070091 "libnativedisplay",
Derek Sollenbergere78f7c92019-07-31 15:18:47 -040092 "libnativewindow",
Fedor Kudasov182cbf92019-06-05 10:30:20 +010093 "libprotobuf-cpp-lite",
94 "libft2",
95 "libandroidfw",
96 "libcrypto",
97 "libsync",
98 ],
99 static_libs: [
100 "libEGL_blobCache",
101 ],
102 },
103 host: {
104 static_libs: [
105 "libandroidfw",
106 "libutils",
107 ],
108 }
109 }
Colin Crossf6298102017-04-19 15:25:25 -0700110}
111
112cc_defaults {
113 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -0700114 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
115}
116
117cc_defaults {
118 name: "hwui_compile_for_perf",
119 // TODO: Non-arm?
120 cflags: [
121 "-fno-omit-frame-pointer",
122 "-marm",
123 "-mapcs",
124 ],
125}
126
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800127// Build libhwui with PGO by default.
128// Location of PGO profile data is defined in build/soong/cc/pgo.go
129// and is separate from hwui.
130// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
131// or set enable_profile_use property to false.
132cc_defaults {
133 name: "hwui_pgo",
134
135 pgo: {
136 instrumentation: true,
137 profile_file: "hwui/hwui.profdata",
138 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800139 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800140 },
141}
142
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800143// Build hwui library with ThinLTO by default.
144cc_defaults {
145 name: "hwui_lto",
146 target: {
147 android: {
148 lto: {
149 thin: true,
150 },
151 },
152 },
153}
154
Colin Crossf6298102017-04-19 15:25:25 -0700155// ------------------------
156// library
157// ------------------------
158
159cc_defaults {
160 name: "libhwui_defaults",
161 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400162
163 whole_static_libs: ["libskia"],
164
Colin Crossf6298102017-04-19 15:25:25 -0700165 srcs: [
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100166 "pipeline/skia/SkiaDisplayList.cpp",
167 "pipeline/skia/SkiaRecordingCanvas.cpp",
168 "pipeline/skia/RenderNodeDrawable.cpp",
169 "pipeline/skia/ReorderBarrierDrawables.cpp",
Fedor Kudasov666f8a52019-07-03 15:21:14 +0100170 "renderthread/Frame.cpp",
171 "renderthread/RenderTask.cpp",
172 "renderthread/TimeLord.cpp",
Derek Sollenberger2d142132018-01-22 10:25:26 -0500173 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500174 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700175 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700176 "hwui/Canvas.cpp",
177 "hwui/MinikinSkia.cpp",
178 "hwui/MinikinUtils.cpp",
179 "hwui/PaintImpl.cpp",
180 "hwui/Typeface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700181 "utils/Blur.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100182 "utils/Color.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700183 "utils/LinearAllocator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700184 "utils/VectorDrawableUtils.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100185 "AnimationContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700186 "Animator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100187 "AnimatorManager.cpp",
188 "CanvasTransform.cpp",
189 "DamageAccumulator.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700190 "Interpolator.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100191 "LightingInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700192 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700193 "PathParser.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700194 "Properties.cpp",
195 "PropertyValuesAnimatorSet.cpp",
196 "PropertyValuesHolder.cpp",
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100197 "RecordingCanvas.cpp",
198 "RenderNode.cpp",
199 "RenderProperties.cpp",
Fedor Kudasov09cfce02019-07-04 09:41:13 +0100200 "RootRenderNode.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700201 "SkiaCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700202 "VectorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700203 ],
204
Kweku Adams228b6d22018-04-12 13:09:04 -0700205 proto: {
206 export_proto_headers: true,
207 },
208
Colin Crossf6298102017-04-19 15:25:25 -0700209 export_include_dirs: ["."],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100210
211 target: {
212 android: {
213
214 srcs: [
215 "pipeline/skia/GLFunctorDrawable.cpp",
216 "pipeline/skia/LayerDrawable.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100217 "pipeline/skia/ShaderCache.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100218 "pipeline/skia/SkiaMemoryTracer.cpp",
219 "pipeline/skia/SkiaOpenGLPipeline.cpp",
220 "pipeline/skia/SkiaPipeline.cpp",
221 "pipeline/skia/SkiaProfileRenderer.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100222 "pipeline/skia/SkiaVulkanPipeline.cpp",
223 "pipeline/skia/VectorDrawableAtlas.cpp",
224 "pipeline/skia/VkFunctorDrawable.cpp",
225 "pipeline/skia/VkInteropFunctorDrawable.cpp",
226 "renderstate/RenderState.cpp",
227 "renderthread/CacheManager.cpp",
228 "renderthread/CanvasContext.cpp",
229 "renderthread/DrawFrameTask.cpp",
230 "renderthread/EglManager.cpp",
231 "renderthread/ReliableSurface.cpp",
232 "renderthread/VulkanManager.cpp",
233 "renderthread/VulkanSurface.cpp",
234 "renderthread/RenderProxy.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100235 "renderthread/RenderThread.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100236 "service/GraphicsStatsService.cpp",
237 "surfacetexture/EGLConsumer.cpp",
238 "surfacetexture/ImageConsumer.cpp",
239 "surfacetexture/SurfaceTexture.cpp",
240 "thread/CommonPool.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100241 "utils/GLUtils.cpp",
242 "utils/StringUtils.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100243 "DeferredLayerUpdater.cpp",
244 "DeviceInfo.cpp",
245 "FrameInfo.cpp",
246 "FrameInfoVisualizer.cpp",
247 "GpuMemoryTracker.cpp",
248 "HardwareBitmapUploader.cpp",
249 "HWUIProperties.sysprop",
250 "JankTracker.cpp",
251 "Layer.cpp",
252 "LayerUpdateQueue.cpp",
253 "ProfileData.cpp",
254 "ProfileDataContainer.cpp",
255 "Readback.cpp",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100256 "TreeInfo.cpp",
257 "WebViewFunctorManager.cpp",
258 "protos/graphicsstats.proto",
259 ],
260
261 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
262 cflags: ["-Wno-implicit-fallthrough"],
263 },
264 host: {
Fedor Kudasov86bd2142019-06-18 15:51:57 +0100265 srcs: [
266 "utils/HostColorSpace.cpp",
267 ],
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100268 export_static_lib_headers: [
269 "libarect",
270 ],
271 }
272 }
Colin Crossf6298102017-04-19 15:25:25 -0700273}
274
275cc_library {
276 name: "libhwui",
Fedor Kudasov182cbf92019-06-05 10:30:20 +0100277 host_supported: true,
Chris Craikd17b63c2017-06-01 10:45:36 -0700278 defaults: [
279 "libhwui_defaults",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700280 ],
Colin Crossf6298102017-04-19 15:25:25 -0700281}
282
Colin Crossf6298102017-04-19 15:25:25 -0700283cc_library_static {
John Reck23462d82019-05-29 16:55:06 -0700284 name: "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700285 defaults: [
286 "libhwui_defaults",
Colin Crossf6298102017-04-19 15:25:25 -0700287 ],
Colin Crossf6298102017-04-19 15:25:25 -0700288}
289
290cc_defaults {
291 name: "hwui_test_defaults",
292 defaults: ["hwui_defaults"],
293 test_suites: ["device-tests"],
294 srcs: [
295 "tests/common/scenes/*.cpp",
296 "tests/common/LeakChecker.cpp",
297 "tests/common/TestListViewSceneBase.cpp",
298 "tests/common/TestContext.cpp",
299 "tests/common/TestScene.cpp",
300 "tests/common/TestUtils.cpp",
301 ],
302}
303
304// ------------------------
305// unit tests
306// ------------------------
307
308cc_test {
309 name: "hwui_unit_tests",
310 defaults: ["hwui_test_defaults"],
311
312 static_libs: [
313 "libgmock",
John Reck23462d82019-05-29 16:55:06 -0700314 "libhwui_static",
Colin Crossf6298102017-04-19 15:25:25 -0700315 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800316 shared_libs: [
317 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800318 ],
Colin Crossf6298102017-04-19 15:25:25 -0700319
320 srcs: [
321 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400322 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700323 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700324 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700325 "tests/unit/DamageAccumulatorTests.cpp",
326 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700327 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700328 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700329 "tests/unit/GraphicsStatsServiceTests.cpp",
330 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/LinearAllocatorTests.cpp",
332 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700333 "tests/unit/PathInterpolatorTests.cpp",
334 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700335 "tests/unit/RenderNodeTests.cpp",
336 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800337 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400338 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700339 "tests/unit/SkiaBehaviorTests.cpp",
340 "tests/unit/SkiaDisplayListTests.cpp",
341 "tests/unit/SkiaPipelineTests.cpp",
342 "tests/unit/SkiaRenderPropertiesTests.cpp",
343 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700344 "tests/unit/StringUtilsTests.cpp",
345 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700346 "tests/unit/ThreadBaseTests.cpp",
347 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700348 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400349 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800350 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700351 ],
352}
353
354// ------------------------
355// Macro-bench app
356// ------------------------
357
358cc_benchmark {
359 name: "hwuimacro",
360 defaults: ["hwui_test_defaults"],
361
John Reck23462d82019-05-29 16:55:06 -0700362 static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800363 shared_libs: [
364 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800365 ],
Colin Crossf6298102017-04-19 15:25:25 -0700366
367 srcs: [
368 "tests/macrobench/TestSceneRunner.cpp",
369 "tests/macrobench/main.cpp",
370 ],
371}
372
373// ------------------------
374// Micro-bench app
375// ---------------------
376
377cc_benchmark {
378 name: "hwuimicro",
379 defaults: ["hwui_test_defaults"],
380
John Reck23462d82019-05-29 16:55:06 -0700381 static_libs: ["libhwui_static"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800382 shared_libs: [
383 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800384 ],
Colin Crossf6298102017-04-19 15:25:25 -0700385
386 srcs: [
387 "tests/microbench/main.cpp",
388 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700389 "tests/microbench/LinearAllocatorBench.cpp",
390 "tests/microbench/PathParserBench.cpp",
391 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700392 ],
393}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800394
395// ----------------------------------------
396// Phony target to build benchmarks for PGO
397// ----------------------------------------
398
399phony {
400 name: "pgo-targets-hwui",
401 required: [
402 "hwuimicro",
403 "hwuimacro",
404 ]
405}