blob: 6585bfc929ba47237c9f1eadfafdb9f2249bb1bf [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",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500211 "HWUIProperties.sysprop",
Colin Crossf6298102017-04-19 15:25:25 -0700212 "Interpolator.cpp",
213 "JankTracker.cpp",
214 "Layer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700215 "LayerUpdateQueue.cpp",
216 "Matrix.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700217 "PathParser.cpp",
John Reck7075c792017-07-05 14:03:43 -0700218 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700219 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700220 "Properties.cpp",
221 "PropertyValuesAnimatorSet.cpp",
222 "PropertyValuesHolder.cpp",
Stan Iliev1a025a72018-09-05 16:35:11 -0400223 "Readback.cpp",
John Reck8f45d4a2018-08-15 10:17:12 -0700224 "RecordingCanvas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700225 "RenderNode.cpp",
226 "RenderProperties.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700227 "SkiaCanvas.cpp",
John Reckbb3a3582018-09-26 11:21:08 -0700228 "TreeInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700229 "VectorDrawable.cpp",
Kweku Adams228b6d22018-04-12 13:09:04 -0700230 "protos/graphicsstats.proto",
Colin Crossf6298102017-04-19 15:25:25 -0700231 ],
232
Chih-Hung Hsiehe1afb6c2018-10-22 12:25:50 -0700233 // Allow implicit fallthroughs in HardwareBitmapUploader.cpp until they are fixed.
234 cflags: ["-Wno-implicit-fallthrough"],
235
Kweku Adams228b6d22018-04-12 13:09:04 -0700236 proto: {
237 export_proto_headers: true,
238 },
239
Colin Crossf6298102017-04-19 15:25:25 -0700240 export_include_dirs: ["."],
241}
242
243cc_library {
244 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700245 defaults: [
246 "libhwui_defaults",
247
248 // Enables fine-grained GLES error checking
249 // If enabled, every GLES call is wrapped & error checked
250 // Has moderate overhead
John Reckbdc9f1b2018-09-14 15:22:35 -0700251 //"hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700252 ],
Colin Crossf6298102017-04-19 15:25:25 -0700253}
254
255// ------------------------
256// static library null gpu
257// ------------------------
258
259cc_library_static {
260 name: "libhwui_static_debug",
261 defaults: [
262 "libhwui_defaults",
263 "hwui_debug",
264 ],
265 cflags: ["-DHWUI_NULL_GPU"],
266 srcs: [
267 "debug/nullegl.cpp",
268 ],
Colin Crossf6298102017-04-19 15:25:25 -0700269}
270
271cc_defaults {
272 name: "hwui_test_defaults",
273 defaults: ["hwui_defaults"],
274 test_suites: ["device-tests"],
275 srcs: [
276 "tests/common/scenes/*.cpp",
277 "tests/common/LeakChecker.cpp",
278 "tests/common/TestListViewSceneBase.cpp",
279 "tests/common/TestContext.cpp",
280 "tests/common/TestScene.cpp",
281 "tests/common/TestUtils.cpp",
282 ],
283}
284
285// ------------------------
286// unit tests
287// ------------------------
288
289cc_test {
290 name: "hwui_unit_tests",
291 defaults: ["hwui_test_defaults"],
292
293 static_libs: [
294 "libgmock",
295 "libhwui_static_debug",
296 ],
Tej Singhbb8554a2018-01-26 11:59:14 -0800297 shared_libs: [
298 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800299 ],
Colin Crossf6298102017-04-19 15:25:25 -0700300 cflags: [
301 "-include debug/wrap_gles.h",
302 "-DHWUI_NULL_GPU",
303 ],
304
305 srcs: [
306 "tests/unit/main.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400307 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700308 "tests/unit/CanvasContextTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700309 "tests/unit/DamageAccumulatorTests.cpp",
310 "tests/unit/DeferredLayerUpdaterTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700311 "tests/unit/FatVectorTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700312 "tests/unit/GpuMemoryTrackerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700313 "tests/unit/GraphicsStatsServiceTests.cpp",
314 "tests/unit/LayerUpdateQueueTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700315 "tests/unit/LinearAllocatorTests.cpp",
316 "tests/unit/MatrixTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700317 "tests/unit/PathInterpolatorTests.cpp",
318 "tests/unit/RenderNodeDrawableTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700319 "tests/unit/RenderNodeTests.cpp",
320 "tests/unit/RenderPropertiesTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400321 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700322 "tests/unit/SkiaBehaviorTests.cpp",
323 "tests/unit/SkiaDisplayListTests.cpp",
324 "tests/unit/SkiaPipelineTests.cpp",
325 "tests/unit/SkiaRenderPropertiesTests.cpp",
326 "tests/unit/SkiaCanvasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700327 "tests/unit/StringUtilsTests.cpp",
328 "tests/unit/TestUtilsTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700329 "tests/unit/ThreadBaseTests.cpp",
330 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400332 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700333 ],
334}
335
336// ------------------------
337// Macro-bench app
338// ------------------------
339
340cc_benchmark {
341 name: "hwuimacro",
342 defaults: ["hwui_test_defaults"],
343
344 // set to libhwui_static_debug to skip actual GL commands
345 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800346 shared_libs: [
347 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800348 ],
Colin Crossf6298102017-04-19 15:25:25 -0700349
350 srcs: [
351 "tests/macrobench/TestSceneRunner.cpp",
352 "tests/macrobench/main.cpp",
353 ],
354}
355
356// ------------------------
357// Micro-bench app
358// ---------------------
359
360cc_benchmark {
361 name: "hwuimicro",
362 defaults: ["hwui_test_defaults"],
363
364 cflags: [
365 "-include debug/wrap_gles.h",
366 "-DHWUI_NULL_GPU",
367 ],
368
369 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800370 shared_libs: [
371 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800372 ],
Colin Crossf6298102017-04-19 15:25:25 -0700373
374 srcs: [
375 "tests/microbench/main.cpp",
376 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700377 "tests/microbench/LinearAllocatorBench.cpp",
378 "tests/microbench/PathParserBench.cpp",
379 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700380 "tests/microbench/TaskManagerBench.cpp",
381 ],
382}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800383
384// ----------------------------------------
385// Phony target to build benchmarks for PGO
386// ----------------------------------------
387
388phony {
389 name: "pgo-targets-hwui",
390 required: [
391 "hwuimicro",
392 "hwuimacro",
393 ]
394}