blob: 96798f97846595d09dba6371882d40eb51ff72c1 [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",
31
32 // TODO: Linear blending should be enabled by default, but we are
33 // TODO: making it an opt-in while it's a work in progress
34 //"-DANDROID_ENABLE_LINEAR_BLENDING",
35 ],
36
37 include_dirs: [
38 "external/skia/include/private",
39 "external/skia/src/core",
40 "external/skia/src/effects",
41 "external/skia/src/image",
42 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040043 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040044 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070045 ],
46
47 product_variables: {
John Reck27294182018-07-11 11:21:09 -070048 eng: {
49 lto: {
50 never: true,
51 },
52 },
Colin Crossf6298102017-04-19 15:25:25 -070053 },
54}
55
56cc_defaults {
57 name: "hwui_static_deps",
58 shared_libs: [
59 "liblog",
60 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070061 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070062 "libutils",
63 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010064 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070065 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010066 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070067 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070068 "libui",
69 "libgui",
John Reck915883b2017-05-03 10:27:20 -070070 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070071 "libharfbuzz_ng",
72 "libft2",
73 "libminikin",
74 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080075 "libcrypto",
Colin Crossf6298102017-04-19 15:25:25 -070076 ],
77 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040078 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070079 ],
80}
81
82cc_defaults {
83 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070084 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
85}
86
87cc_defaults {
88 name: "hwui_compile_for_perf",
89 // TODO: Non-arm?
90 cflags: [
91 "-fno-omit-frame-pointer",
92 "-marm",
93 "-mapcs",
94 ],
95}
96
97cc_defaults {
98 name: "hwui_debug",
99 cflags: ["-include debug/wrap_gles.h"],
100 srcs: [
101 "debug/wrap_gles.cpp",
102 "debug/DefaultGlesDriver.cpp",
103 "debug/GlesErrorCheckWrapper.cpp",
104 "debug/GlesDriver.cpp",
105 "debug/FatalBaseDriver.cpp",
106 "debug/NullGlesDriver.cpp",
107 ],
108 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
109}
110
111cc_defaults {
112 name: "hwui_enable_opengl_validation",
113 defaults: ["hwui_debug"],
114 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700115 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
116}
117
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800118// Build libhwui with PGO by default.
119// Location of PGO profile data is defined in build/soong/cc/pgo.go
120// and is separate from hwui.
121// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
122// or set enable_profile_use property to false.
123cc_defaults {
124 name: "hwui_pgo",
125
126 pgo: {
127 instrumentation: true,
128 profile_file: "hwui/hwui.profdata",
129 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800130 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800131 },
132}
133
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800134// Build hwui library with ThinLTO by default.
135cc_defaults {
136 name: "hwui_lto",
137 target: {
138 android: {
139 lto: {
140 thin: true,
141 },
142 },
143 },
144}
145
Colin Crossf6298102017-04-19 15:25:25 -0700146// ------------------------
147// library
148// ------------------------
149
150cc_defaults {
151 name: "libhwui_defaults",
152 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400153
154 whole_static_libs: ["libskia"],
155
Colin Crossf6298102017-04-19 15:25:25 -0700156 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500157 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500158 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700159 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700160 "hwui/Canvas.cpp",
161 "hwui/MinikinSkia.cpp",
162 "hwui/MinikinUtils.cpp",
163 "hwui/PaintImpl.cpp",
164 "hwui/Typeface.cpp",
165 "pipeline/skia/GLFunctorDrawable.cpp",
166 "pipeline/skia/LayerDrawable.cpp",
167 "pipeline/skia/RenderNodeDrawable.cpp",
168 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400169 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700170 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400171 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700172 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700173 "pipeline/skia/SkiaPipeline.cpp",
174 "pipeline/skia/SkiaProfileRenderer.cpp",
175 "pipeline/skia/SkiaRecordingCanvas.cpp",
176 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400177 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800178 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800179 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400181 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700183 "renderthread/DrawFrameTask.cpp",
184 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800185 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700186 "renderthread/VulkanManager.cpp",
187 "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",
Colin Crossf6298102017-04-19 15:25:25 -0700196 "thread/TaskManager.cpp",
197 "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
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700237 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
238 cflags: ["-Wno-implicit-fallthrough"],
239
Kweku Adams228b6d22018-04-12 13:09:04 -0700240 proto: {
241 export_proto_headers: true,
242 },
243
Colin Crossf6298102017-04-19 15:25:25 -0700244 export_include_dirs: ["."],
245}
246
247cc_library {
248 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700249 defaults: [
250 "libhwui_defaults",
251
252 // Enables fine-grained GLES error checking
253 // If enabled, every GLES call is wrapped & error checked
254 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700255 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700256 ],
Colin Crossf6298102017-04-19 15:25:25 -0700257}
258
259// ------------------------
260// static library null gpu
261// ------------------------
262
263cc_library_static {
264 name: "libhwui_static_debug",
265 defaults: [
266 "libhwui_defaults",
267 "hwui_debug",
268 ],
269 cflags: ["-DHWUI_NULL_GPU"],
270 srcs: [
271 "debug/nullegl.cpp",
272 ],
Colin Crossf6298102017-04-19 15:25:25 -0700273}
274
275cc_defaults {
276 name: "hwui_test_defaults",
277 defaults: ["hwui_defaults"],
278 test_suites: ["device-tests"],
279 srcs: [
280 "tests/common/scenes/*.cpp",
281 "tests/common/LeakChecker.cpp",
282 "tests/common/TestListViewSceneBase.cpp",
283 "tests/common/TestContext.cpp",
284 "tests/common/TestScene.cpp",
285 "tests/common/TestUtils.cpp",
286 ],
287}
288
289// ------------------------
290// unit tests
291// ------------------------
292
293cc_test {
294 name: "hwui_unit_tests",
295 defaults: ["hwui_test_defaults"],
296
297 static_libs: [
298 "libgmock",
299 "libhwui_static_debug",
300 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800301 shared_libs: [
302 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800303 ],
Colin Crossf6298102017-04-19 15:25:25 -0700304 cflags: [
305 "-include debug/wrap_gles.h",
306 "-DHWUI_NULL_GPU",
307 ],
308
309 srcs: [
310 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400311 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700312 "tests/unit/CanvasContextTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700313 "tests/unit/DamageAccumulatorTests.cpp",
314 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700316 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/GraphicsStatsServiceTests.cpp",
318 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/LinearAllocatorTests.cpp",
320 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/PathInterpolatorTests.cpp",
322 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700323 "tests/unit/RenderNodeTests.cpp",
324 "tests/unit/RenderPropertiesTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400325 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700326 "tests/unit/SkiaBehaviorTests.cpp",
327 "tests/unit/SkiaDisplayListTests.cpp",
328 "tests/unit/SkiaPipelineTests.cpp",
329 "tests/unit/SkiaRenderPropertiesTests.cpp",
330 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/StringUtilsTests.cpp",
332 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700333 "tests/unit/ThreadBaseTests.cpp",
334 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700335 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400336 "tests/unit/VectorDrawableAtlasTests.cpp",
John Reck283bb462018-12-13 16:40:14 -0800337 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700338 ],
339}
340
341// ------------------------
342// Macro-bench app
343// ------------------------
344
345cc_benchmark {
346 name: "hwuimacro",
347 defaults: ["hwui_test_defaults"],
348
349 // set to libhwui_static_debug to skip actual GL commands
350 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800351 shared_libs: [
352 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800353 ],
Colin Crossf6298102017-04-19 15:25:25 -0700354
355 srcs: [
356 "tests/macrobench/TestSceneRunner.cpp",
357 "tests/macrobench/main.cpp",
358 ],
359}
360
361// ------------------------
362// Micro-bench app
363// ---------------------
364
365cc_benchmark {
366 name: "hwuimicro",
367 defaults: ["hwui_test_defaults"],
368
369 cflags: [
370 "-include debug/wrap_gles.h",
371 "-DHWUI_NULL_GPU",
372 ],
373
374 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800375 shared_libs: [
376 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800377 ],
Colin Crossf6298102017-04-19 15:25:25 -0700378
379 srcs: [
380 "tests/microbench/main.cpp",
381 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700382 "tests/microbench/LinearAllocatorBench.cpp",
383 "tests/microbench/PathParserBench.cpp",
384 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700385 "tests/microbench/TaskManagerBench.cpp",
386 ],
387}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800388
389// ----------------------------------------
390// Phony target to build benchmarks for PGO
391// ----------------------------------------
392
393phony {
394 name: "pgo-targets-hwui",
395 required: [
396 "hwuimicro",
397 "hwuimacro",
398 ]
399}