blob: 4c08a38299346027780b7b8755354f295939f306 [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
Yi Kong304d4bd2019-10-14 01:53:46 -070029 // Clang is producing non-determistic binary when the new pass manager is
30 // enabled. Disable the new PM as a temporary workaround.
31 // b/142372146
32 "-fno-experimental-new-pass-manager",
Colin Crossf6298102017-04-19 15:25:25 -070033 ],
34
35 include_dirs: [
36 "external/skia/include/private",
37 "external/skia/src/core",
38 "external/skia/src/effects",
39 "external/skia/src/image",
40 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040041 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040042 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070043 ],
44
45 product_variables: {
John Reck27294182018-07-11 11:21:09 -070046 eng: {
47 lto: {
48 never: true,
49 },
50 },
Colin Crossf6298102017-04-19 15:25:25 -070051 },
52}
53
54cc_defaults {
55 name: "hwui_static_deps",
56 shared_libs: [
57 "liblog",
58 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070059 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070060 "libutils",
61 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010062 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070063 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010064 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070065 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070066 "libui",
67 "libgui",
John Reck915883b2017-05-03 10:27:20 -070068 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070069 "libharfbuzz_ng",
70 "libft2",
71 "libminikin",
72 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080073 "libcrypto",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -050074 "libsync",
Colin Crossf6298102017-04-19 15:25:25 -070075 ],
76 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040077 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070078 ],
79}
80
81cc_defaults {
82 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070083 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
84}
85
86cc_defaults {
87 name: "hwui_compile_for_perf",
88 // TODO: Non-arm?
89 cflags: [
90 "-fno-omit-frame-pointer",
91 "-marm",
92 "-mapcs",
93 ],
94}
95
96cc_defaults {
97 name: "hwui_debug",
98 cflags: ["-include debug/wrap_gles.h"],
99 srcs: [
100 "debug/wrap_gles.cpp",
101 "debug/DefaultGlesDriver.cpp",
102 "debug/GlesErrorCheckWrapper.cpp",
103 "debug/GlesDriver.cpp",
104 "debug/FatalBaseDriver.cpp",
105 "debug/NullGlesDriver.cpp",
106 ],
107 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
108}
109
110cc_defaults {
111 name: "hwui_enable_opengl_validation",
112 defaults: ["hwui_debug"],
113 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700114 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
115}
116
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800117// Build libhwui with PGO by default.
118// Location of PGO profile data is defined in build/soong/cc/pgo.go
119// and is separate from hwui.
120// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
121// or set enable_profile_use property to false.
122cc_defaults {
123 name: "hwui_pgo",
124
125 pgo: {
126 instrumentation: true,
127 profile_file: "hwui/hwui.profdata",
128 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800129 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800130 },
131}
132
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800133// Build hwui library with ThinLTO by default.
134cc_defaults {
135 name: "hwui_lto",
136 target: {
137 android: {
138 lto: {
139 thin: true,
140 },
141 },
142 },
143}
144
Colin Crossf6298102017-04-19 15:25:25 -0700145// ------------------------
146// library
147// ------------------------
148
149cc_defaults {
150 name: "libhwui_defaults",
151 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400152
153 whole_static_libs: ["libskia"],
154
Colin Crossf6298102017-04-19 15:25:25 -0700155 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500156 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500157 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700158 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700159 "hwui/Canvas.cpp",
160 "hwui/MinikinSkia.cpp",
161 "hwui/MinikinUtils.cpp",
162 "hwui/PaintImpl.cpp",
163 "hwui/Typeface.cpp",
164 "pipeline/skia/GLFunctorDrawable.cpp",
165 "pipeline/skia/LayerDrawable.cpp",
166 "pipeline/skia/RenderNodeDrawable.cpp",
167 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400168 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700169 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400170 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700171 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700172 "pipeline/skia/SkiaPipeline.cpp",
173 "pipeline/skia/SkiaProfileRenderer.cpp",
174 "pipeline/skia/SkiaRecordingCanvas.cpp",
175 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400176 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800177 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800178 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700179 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400180 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700181 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 "renderthread/DrawFrameTask.cpp",
183 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800184 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700185 "renderthread/VulkanManager.cpp",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -0500186 "renderthread/VulkanSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700187 "renderthread/RenderProxy.cpp",
188 "renderthread/RenderTask.cpp",
189 "renderthread/RenderThread.cpp",
190 "renderthread/TimeLord.cpp",
191 "renderthread/Frame.cpp",
192 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000193 "surfacetexture/EGLConsumer.cpp",
194 "surfacetexture/ImageConsumer.cpp",
195 "surfacetexture/SurfaceTexture.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700196 "thread/CommonPool.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700197 "utils/Blur.cpp",
198 "utils/Color.cpp",
199 "utils/GLUtils.cpp",
200 "utils/LinearAllocator.cpp",
201 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700202 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700203 "AnimationContext.cpp",
204 "Animator.cpp",
205 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700206 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700207 "DamageAccumulator.cpp",
208 "DeferredLayerUpdater.cpp",
209 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700210 "FrameInfo.cpp",
211 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700212 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700213 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500214 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700215 "Interpolator.cpp",
216 "JankTracker.cpp",
217 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700218 "LayerUpdateQueue.cpp",
219 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700220 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700221 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700222 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700223 "Properties.cpp",
224 "PropertyValuesAnimatorSet.cpp",
225 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400226 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700227 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700228 "RenderNode.cpp",
229 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700230 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700231 "TreeInfo.cpp",
John Reck283bb462018-12-13 16:40:14 -0800232 "WebViewFunctorManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700233 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700234 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700235 ],
236
Kweku Adams228b6d22018-04-12 13:09:04 -0700237 proto: {
238 export_proto_headers: true,
239 },
240
Colin Crossf6298102017-04-19 15:25:25 -0700241 export_include_dirs: ["."],
242}
243
244cc_library {
245 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700246 defaults: [
247 "libhwui_defaults",
248
249 // Enables fine-grained GLES error checking
250 // If enabled, every GLES call is wrapped & error checked
251 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700252 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700253 ],
Colin Crossf6298102017-04-19 15:25:25 -0700254}
255
256// ------------------------
257// static library null gpu
258// ------------------------
259
260cc_library_static {
261 name: "libhwui_static_debug",
262 defaults: [
263 "libhwui_defaults",
264 "hwui_debug",
265 ],
266 cflags: ["-DHWUI_NULL_GPU"],
267 srcs: [
268 "debug/nullegl.cpp",
269 ],
Colin Crossf6298102017-04-19 15:25:25 -0700270}
271
272cc_defaults {
273 name: "hwui_test_defaults",
274 defaults: ["hwui_defaults"],
275 test_suites: ["device-tests"],
276 srcs: [
277 "tests/common/scenes/*.cpp",
278 "tests/common/LeakChecker.cpp",
279 "tests/common/TestListViewSceneBase.cpp",
280 "tests/common/TestContext.cpp",
281 "tests/common/TestScene.cpp",
282 "tests/common/TestUtils.cpp",
283 ],
284}
285
286// ------------------------
287// unit tests
288// ------------------------
289
290cc_test {
291 name: "hwui_unit_tests",
292 defaults: ["hwui_test_defaults"],
293
294 static_libs: [
295 "libgmock",
296 "libhwui_static_debug",
297 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800298 shared_libs: [
299 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800300 ],
Colin Crossf6298102017-04-19 15:25:25 -0700301 cflags: [
302 "-include debug/wrap_gles.h",
303 "-DHWUI_NULL_GPU",
304 ],
305
306 srcs: [
307 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400308 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700309 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700310 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700311 "tests/unit/DamageAccumulatorTests.cpp",
312 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700313 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700314 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/GraphicsStatsServiceTests.cpp",
316 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/LinearAllocatorTests.cpp",
318 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/PathInterpolatorTests.cpp",
320 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/RenderNodeTests.cpp",
322 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800323 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400324 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700325 "tests/unit/SkiaBehaviorTests.cpp",
326 "tests/unit/SkiaDisplayListTests.cpp",
327 "tests/unit/SkiaPipelineTests.cpp",
328 "tests/unit/SkiaRenderPropertiesTests.cpp",
329 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700330 "tests/unit/StringUtilsTests.cpp",
331 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700332 "tests/unit/ThreadBaseTests.cpp",
333 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700334 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400335 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800336 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700337 ],
338}
339
340// ------------------------
341// Macro-bench app
342// ------------------------
343
344cc_benchmark {
345 name: "hwuimacro",
346 defaults: ["hwui_test_defaults"],
347
348 // set to libhwui_static_debug to skip actual GL commands
349 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800350 shared_libs: [
351 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800352 ],
Colin Crossf6298102017-04-19 15:25:25 -0700353
354 srcs: [
355 "tests/macrobench/TestSceneRunner.cpp",
356 "tests/macrobench/main.cpp",
357 ],
358}
359
360// ------------------------
361// Micro-bench app
362// ---------------------
363
364cc_benchmark {
365 name: "hwuimicro",
366 defaults: ["hwui_test_defaults"],
367
368 cflags: [
369 "-include debug/wrap_gles.h",
370 "-DHWUI_NULL_GPU",
371 ],
372
373 whole_static_libs: ["libhwui_static_debug"],
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}