blob: 98de9c3ea88e0a09208a2ad679980617321df01a [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",
Colin Crossf6298102017-04-19 15:25:25 -070028 ],
29
30 include_dirs: [
31 "external/skia/include/private",
32 "external/skia/src/core",
33 "external/skia/src/effects",
34 "external/skia/src/image",
35 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040036 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040037 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070038 ],
39
40 product_variables: {
John Reck27294182018-07-11 11:21:09 -070041 eng: {
42 lto: {
43 never: true,
44 },
45 },
Colin Crossf6298102017-04-19 15:25:25 -070046 },
47}
48
49cc_defaults {
50 name: "hwui_static_deps",
51 shared_libs: [
52 "liblog",
53 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070054 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070055 "libutils",
56 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010057 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070058 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010059 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070060 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070061 "libui",
62 "libgui",
John Reck915883b2017-05-03 10:27:20 -070063 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070064 "libharfbuzz_ng",
65 "libft2",
66 "libminikin",
67 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080068 "libcrypto",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -050069 "libsync",
Colin Crossf6298102017-04-19 15:25:25 -070070 ],
71 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040072 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070073 ],
74}
75
76cc_defaults {
77 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070078 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
79}
80
81cc_defaults {
82 name: "hwui_compile_for_perf",
83 // TODO: Non-arm?
84 cflags: [
85 "-fno-omit-frame-pointer",
86 "-marm",
87 "-mapcs",
88 ],
89}
90
91cc_defaults {
92 name: "hwui_debug",
93 cflags: ["-include debug/wrap_gles.h"],
94 srcs: [
95 "debug/wrap_gles.cpp",
96 "debug/DefaultGlesDriver.cpp",
97 "debug/GlesErrorCheckWrapper.cpp",
98 "debug/GlesDriver.cpp",
99 "debug/FatalBaseDriver.cpp",
100 "debug/NullGlesDriver.cpp",
101 ],
102 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
103}
104
105cc_defaults {
106 name: "hwui_enable_opengl_validation",
107 defaults: ["hwui_debug"],
108 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700109 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
110}
111
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800112// Build libhwui with PGO by default.
113// Location of PGO profile data is defined in build/soong/cc/pgo.go
114// and is separate from hwui.
115// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
116// or set enable_profile_use property to false.
117cc_defaults {
118 name: "hwui_pgo",
119
120 pgo: {
121 instrumentation: true,
122 profile_file: "hwui/hwui.profdata",
123 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800124 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800125 },
126}
127
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800128// Build hwui library with ThinLTO by default.
129cc_defaults {
130 name: "hwui_lto",
131 target: {
132 android: {
133 lto: {
134 thin: true,
135 },
136 },
137 },
138}
139
Colin Crossf6298102017-04-19 15:25:25 -0700140// ------------------------
141// library
142// ------------------------
143
144cc_defaults {
145 name: "libhwui_defaults",
146 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400147
148 whole_static_libs: ["libskia"],
149
Colin Crossf6298102017-04-19 15:25:25 -0700150 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500151 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500152 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700153 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700154 "hwui/Canvas.cpp",
155 "hwui/MinikinSkia.cpp",
156 "hwui/MinikinUtils.cpp",
157 "hwui/PaintImpl.cpp",
158 "hwui/Typeface.cpp",
159 "pipeline/skia/GLFunctorDrawable.cpp",
160 "pipeline/skia/LayerDrawable.cpp",
161 "pipeline/skia/RenderNodeDrawable.cpp",
162 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400163 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700164 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400165 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700166 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700167 "pipeline/skia/SkiaPipeline.cpp",
168 "pipeline/skia/SkiaProfileRenderer.cpp",
169 "pipeline/skia/SkiaRecordingCanvas.cpp",
170 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400171 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800172 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800173 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700174 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400175 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700176 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700177 "renderthread/DrawFrameTask.cpp",
178 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800179 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "renderthread/VulkanManager.cpp",
Derek Sollenbergera19b71a2019-02-15 16:36:30 -0500181 "renderthread/VulkanSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 "renderthread/RenderProxy.cpp",
183 "renderthread/RenderTask.cpp",
184 "renderthread/RenderThread.cpp",
185 "renderthread/TimeLord.cpp",
186 "renderthread/Frame.cpp",
187 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000188 "surfacetexture/EGLConsumer.cpp",
189 "surfacetexture/ImageConsumer.cpp",
190 "surfacetexture/SurfaceTexture.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700191 "thread/CommonPool.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700192 "utils/Blur.cpp",
193 "utils/Color.cpp",
194 "utils/GLUtils.cpp",
195 "utils/LinearAllocator.cpp",
196 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700197 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700198 "AnimationContext.cpp",
199 "Animator.cpp",
200 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700201 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700202 "DamageAccumulator.cpp",
203 "DeferredLayerUpdater.cpp",
204 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700205 "FrameInfo.cpp",
206 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700207 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700208 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500209 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700210 "Interpolator.cpp",
211 "JankTracker.cpp",
212 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700213 "LayerUpdateQueue.cpp",
214 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700215 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700216 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700217 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700218 "Properties.cpp",
219 "PropertyValuesAnimatorSet.cpp",
220 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400221 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700222 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700223 "RenderNode.cpp",
224 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700225 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700226 "TreeInfo.cpp",
John Reck283bb462018-12-13 16:40:14 -0800227 "WebViewFunctorManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700228 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700229 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700230 ],
231
Kweku Adams228b6d22018-04-12 13:09:04 -0700232 proto: {
233 export_proto_headers: true,
234 },
235
Colin Crossf6298102017-04-19 15:25:25 -0700236 export_include_dirs: ["."],
237}
238
239cc_library {
240 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700241 defaults: [
242 "libhwui_defaults",
243
244 // Enables fine-grained GLES error checking
245 // If enabled, every GLES call is wrapped & error checked
246 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700247 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700248 ],
Colin Crossf6298102017-04-19 15:25:25 -0700249}
250
251// ------------------------
252// static library null gpu
253// ------------------------
254
255cc_library_static {
256 name: "libhwui_static_debug",
257 defaults: [
258 "libhwui_defaults",
259 "hwui_debug",
260 ],
261 cflags: ["-DHWUI_NULL_GPU"],
262 srcs: [
263 "debug/nullegl.cpp",
264 ],
Colin Crossf6298102017-04-19 15:25:25 -0700265}
266
267cc_defaults {
268 name: "hwui_test_defaults",
269 defaults: ["hwui_defaults"],
270 test_suites: ["device-tests"],
271 srcs: [
272 "tests/common/scenes/*.cpp",
273 "tests/common/LeakChecker.cpp",
274 "tests/common/TestListViewSceneBase.cpp",
275 "tests/common/TestContext.cpp",
276 "tests/common/TestScene.cpp",
277 "tests/common/TestUtils.cpp",
278 ],
279}
280
281// ------------------------
282// unit tests
283// ------------------------
284
285cc_test {
286 name: "hwui_unit_tests",
287 defaults: ["hwui_test_defaults"],
288
289 static_libs: [
290 "libgmock",
291 "libhwui_static_debug",
292 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800293 shared_libs: [
294 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800295 ],
Colin Crossf6298102017-04-19 15:25:25 -0700296 cflags: [
297 "-include debug/wrap_gles.h",
298 "-DHWUI_NULL_GPU",
299 ],
300
301 srcs: [
302 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400303 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700304 "tests/unit/CanvasContextTests.cpp",
John Reck322b8ab2019-03-14 13:15:28 -0700305 "tests/unit/CommonPoolTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700306 "tests/unit/DamageAccumulatorTests.cpp",
307 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700308 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700309 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700310 "tests/unit/GraphicsStatsServiceTests.cpp",
311 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700312 "tests/unit/LinearAllocatorTests.cpp",
313 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700314 "tests/unit/PathInterpolatorTests.cpp",
315 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700316 "tests/unit/RenderNodeTests.cpp",
317 "tests/unit/RenderPropertiesTests.cpp",
John Reck700079e2019-02-19 10:38:50 -0800318 "tests/unit/RenderThreadTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400319 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700320 "tests/unit/SkiaBehaviorTests.cpp",
321 "tests/unit/SkiaDisplayListTests.cpp",
322 "tests/unit/SkiaPipelineTests.cpp",
323 "tests/unit/SkiaRenderPropertiesTests.cpp",
324 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700325 "tests/unit/StringUtilsTests.cpp",
326 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700327 "tests/unit/ThreadBaseTests.cpp",
328 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700329 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400330 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800331 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700332 ],
333}
334
335// ------------------------
336// Macro-bench app
337// ------------------------
338
339cc_benchmark {
340 name: "hwuimacro",
341 defaults: ["hwui_test_defaults"],
342
343 // set to libhwui_static_debug to skip actual GL commands
344 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800345 shared_libs: [
346 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800347 ],
Colin Crossf6298102017-04-19 15:25:25 -0700348
349 srcs: [
350 "tests/macrobench/TestSceneRunner.cpp",
351 "tests/macrobench/main.cpp",
352 ],
353}
354
355// ------------------------
356// Micro-bench app
357// ---------------------
358
359cc_benchmark {
360 name: "hwuimicro",
361 defaults: ["hwui_test_defaults"],
362
363 cflags: [
364 "-include debug/wrap_gles.h",
365 "-DHWUI_NULL_GPU",
366 ],
367
368 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800369 shared_libs: [
370 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800371 ],
Colin Crossf6298102017-04-19 15:25:25 -0700372
373 srcs: [
374 "tests/microbench/main.cpp",
375 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700376 "tests/microbench/LinearAllocatorBench.cpp",
377 "tests/microbench/PathParserBench.cpp",
378 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700379 ],
380}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800381
382// ----------------------------------------
383// Phony target to build benchmarks for PGO
384// ----------------------------------------
385
386phony {
387 name: "pgo-targets-hwui",
388 required: [
389 "hwuimicro",
390 "hwuimacro",
391 ]
392}