blob: 0503f36ec0747227b2b8dd59b650f3c2ff817201 [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
12 cflags: [
13 "-DEGL_EGLEXT_PROTOTYPES",
14 "-DGL_GLEXT_PROTOTYPES",
15 "-DATRACE_TAG=ATRACE_TAG_VIEW",
16 "-DLOG_TAG=\"OpenGLRenderer\"",
17 "-Wall",
18 "-Wno-unused-parameter",
19 "-Wunreachable-code",
20 "-Werror",
21 "-fvisibility=hidden",
22
23 // GCC false-positives on this warning, and since we -Werror that's
24 // a problem
25 "-Wno-free-nonheap-object",
26
27 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
28 "-Wno-missing-braces",
29
30 // TODO: Linear blending should be enabled by default, but we are
31 // TODO: making it an opt-in while it's a work in progress
32 //"-DANDROID_ENABLE_LINEAR_BLENDING",
33 ],
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",
62 "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",
Colin Crossf6298102017-04-19 15:25:25 -070073 ],
74 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040075 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070076 ],
77}
78
79cc_defaults {
80 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070081 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
82}
83
84cc_defaults {
85 name: "hwui_compile_for_perf",
86 // TODO: Non-arm?
87 cflags: [
88 "-fno-omit-frame-pointer",
89 "-marm",
90 "-mapcs",
91 ],
92}
93
94cc_defaults {
95 name: "hwui_debug",
96 cflags: ["-include debug/wrap_gles.h"],
97 srcs: [
98 "debug/wrap_gles.cpp",
99 "debug/DefaultGlesDriver.cpp",
100 "debug/GlesErrorCheckWrapper.cpp",
101 "debug/GlesDriver.cpp",
102 "debug/FatalBaseDriver.cpp",
103 "debug/NullGlesDriver.cpp",
104 ],
105 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
106}
107
108cc_defaults {
109 name: "hwui_enable_opengl_validation",
110 defaults: ["hwui_debug"],
111 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700112 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
113}
114
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800115// Build libhwui with PGO by default.
116// Location of PGO profile data is defined in build/soong/cc/pgo.go
117// and is separate from hwui.
118// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
119// or set enable_profile_use property to false.
120cc_defaults {
121 name: "hwui_pgo",
122
123 pgo: {
124 instrumentation: true,
125 profile_file: "hwui/hwui.profdata",
126 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800127 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800128 },
129}
130
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800131// Build hwui library with ThinLTO by default.
132cc_defaults {
133 name: "hwui_lto",
134 target: {
135 android: {
136 lto: {
137 thin: true,
138 },
139 },
140 },
141}
142
Colin Crossf6298102017-04-19 15:25:25 -0700143// ------------------------
144// library
145// ------------------------
146
147cc_defaults {
148 name: "libhwui_defaults",
149 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400150
151 whole_static_libs: ["libskia"],
152
Colin Crossf6298102017-04-19 15:25:25 -0700153 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500154 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500155 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700156 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700157 "hwui/Canvas.cpp",
158 "hwui/MinikinSkia.cpp",
159 "hwui/MinikinUtils.cpp",
160 "hwui/PaintImpl.cpp",
161 "hwui/Typeface.cpp",
162 "pipeline/skia/GLFunctorDrawable.cpp",
163 "pipeline/skia/LayerDrawable.cpp",
164 "pipeline/skia/RenderNodeDrawable.cpp",
165 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400166 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700167 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400168 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700169 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700170 "pipeline/skia/SkiaPipeline.cpp",
171 "pipeline/skia/SkiaProfileRenderer.cpp",
172 "pipeline/skia/SkiaRecordingCanvas.cpp",
173 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400174 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800175 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800176 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700177 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400178 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700179 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700180 "renderthread/DrawFrameTask.cpp",
181 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800182 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700183 "renderthread/VulkanManager.cpp",
184 "renderthread/RenderProxy.cpp",
185 "renderthread/RenderTask.cpp",
186 "renderthread/RenderThread.cpp",
187 "renderthread/TimeLord.cpp",
188 "renderthread/Frame.cpp",
189 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000190 "surfacetexture/EGLConsumer.cpp",
191 "surfacetexture/ImageConsumer.cpp",
192 "surfacetexture/SurfaceTexture.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700193 "thread/TaskManager.cpp",
194 "utils/Blur.cpp",
195 "utils/Color.cpp",
196 "utils/GLUtils.cpp",
197 "utils/LinearAllocator.cpp",
198 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700199 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700200 "AnimationContext.cpp",
201 "Animator.cpp",
202 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700203 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700204 "DamageAccumulator.cpp",
205 "DeferredLayerUpdater.cpp",
206 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700207 "FrameInfo.cpp",
208 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700209 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700210 "HardwareBitmapUploader.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700211 "Interpolator.cpp",
212 "JankTracker.cpp",
213 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700214 "LayerUpdateQueue.cpp",
215 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700216 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700217 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700218 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700219 "Properties.cpp",
220 "PropertyValuesAnimatorSet.cpp",
221 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400222 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700223 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700224 "RenderNode.cpp",
225 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700226 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700227 "TreeInfo.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
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700232 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
233 cflags: ["-Wno-implicit-fallthrough"],
234
Kweku Adams228b6d22018-04-12 13:09:04 -0700235 proto: {
236 export_proto_headers: true,
237 },
238
Colin Crossf6298102017-04-19 15:25:25 -0700239 export_include_dirs: ["."],
240}
241
242cc_library {
243 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700244 defaults: [
245 "libhwui_defaults",
246
247 // Enables fine-grained GLES error checking
248 // If enabled, every GLES call is wrapped & error checked
249 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700250 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700251 ],
Colin Crossf6298102017-04-19 15:25:25 -0700252}
253
254// ------------------------
255// static library null gpu
256// ------------------------
257
258cc_library_static {
259 name: "libhwui_static_debug",
260 defaults: [
261 "libhwui_defaults",
262 "hwui_debug",
263 ],
264 cflags: ["-DHWUI_NULL_GPU"],
265 srcs: [
266 "debug/nullegl.cpp",
267 ],
Colin Crossf6298102017-04-19 15:25:25 -0700268}
269
270cc_defaults {
271 name: "hwui_test_defaults",
272 defaults: ["hwui_defaults"],
273 test_suites: ["device-tests"],
274 srcs: [
275 "tests/common/scenes/*.cpp",
276 "tests/common/LeakChecker.cpp",
277 "tests/common/TestListViewSceneBase.cpp",
278 "tests/common/TestContext.cpp",
279 "tests/common/TestScene.cpp",
280 "tests/common/TestUtils.cpp",
281 ],
282}
283
284// ------------------------
285// unit tests
286// ------------------------
287
288cc_test {
289 name: "hwui_unit_tests",
290 defaults: ["hwui_test_defaults"],
291
292 static_libs: [
293 "libgmock",
294 "libhwui_static_debug",
295 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800296 shared_libs: [
297 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800298 ],
Colin Crossf6298102017-04-19 15:25:25 -0700299 cflags: [
300 "-include debug/wrap_gles.h",
301 "-DHWUI_NULL_GPU",
302 ],
303
304 srcs: [
305 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400306 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700307 "tests/unit/CanvasContextTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700308 "tests/unit/DamageAccumulatorTests.cpp",
309 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700310 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700311 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700312 "tests/unit/GraphicsStatsServiceTests.cpp",
313 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700314 "tests/unit/LinearAllocatorTests.cpp",
315 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700316 "tests/unit/PathInterpolatorTests.cpp",
317 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700318 "tests/unit/RenderNodeTests.cpp",
319 "tests/unit/RenderPropertiesTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400320 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700321 "tests/unit/SkiaBehaviorTests.cpp",
322 "tests/unit/SkiaDisplayListTests.cpp",
323 "tests/unit/SkiaPipelineTests.cpp",
324 "tests/unit/SkiaRenderPropertiesTests.cpp",
325 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700326 "tests/unit/StringUtilsTests.cpp",
327 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700328 "tests/unit/ThreadBaseTests.cpp",
329 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700330 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400331 "tests/unit/VectorDrawableAtlasTests.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 "tests/microbench/TaskManagerBench.cpp",
380 ],
381}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800382
383// ----------------------------------------
384// Phony target to build benchmarks for PGO
385// ----------------------------------------
386
387phony {
388 name: "pgo-targets-hwui",
389 required: [
390 "hwuimicro",
391 "hwuimacro",
392 ]
393}