blob: 0335a7c6bd7d9d7a7506eefad5732d39ed0eeca6 [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",
Colin Crossf6298102017-04-19 15:25:25 -070031 ],
32
33 include_dirs: [
34 "external/skia/include/private",
35 "external/skia/src/core",
36 "external/skia/src/effects",
37 "external/skia/src/image",
38 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040039 "external/skia/src/gpu",
Derek Sollenberger02456f02018-05-30 18:08:57 -040040 "external/skia/src/shaders",
Colin Crossf6298102017-04-19 15:25:25 -070041 ],
42
43 product_variables: {
John Reck27294182018-07-11 11:21:09 -070044 eng: {
45 lto: {
46 never: true,
47 },
48 },
Colin Crossf6298102017-04-19 15:25:25 -070049 },
50}
51
52cc_defaults {
53 name: "hwui_static_deps",
54 shared_libs: [
55 "liblog",
56 "libcutils",
Yangster-macba5bf0d2018-10-09 20:48:23 -070057 "libstatslog",
Colin Crossf6298102017-04-19 15:25:25 -070058 "libutils",
59 "libEGL",
dimitry61dfd8f2018-12-28 22:49:08 +010060 "libGLESv1_CM",
Colin Crossf6298102017-04-19 15:25:25 -070061 "libGLESv2",
dimitrycab37cd2018-12-13 15:36:45 +010062 "libGLESv3",
Colin Crossf6298102017-04-19 15:25:25 -070063 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070064 "libui",
65 "libgui",
John Reck915883b2017-05-03 10:27:20 -070066 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070067 "libharfbuzz_ng",
68 "libft2",
69 "libminikin",
70 "libandroidfw",
Yichi Chen9f959552018-03-29 21:21:54 +080071 "libcrypto",
Colin Crossf6298102017-04-19 15:25:25 -070072 ],
73 static_libs: [
Stan Ilievd495f432017-10-09 15:49:32 -040074 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070075 ],
76}
77
78cc_defaults {
79 name: "hwui_bugreport_font_cache_usage",
Colin Crossf6298102017-04-19 15:25:25 -070080 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
81}
82
83cc_defaults {
84 name: "hwui_compile_for_perf",
85 // TODO: Non-arm?
86 cflags: [
87 "-fno-omit-frame-pointer",
88 "-marm",
89 "-mapcs",
90 ],
91}
92
93cc_defaults {
94 name: "hwui_debug",
95 cflags: ["-include debug/wrap_gles.h"],
96 srcs: [
97 "debug/wrap_gles.cpp",
98 "debug/DefaultGlesDriver.cpp",
99 "debug/GlesErrorCheckWrapper.cpp",
100 "debug/GlesDriver.cpp",
101 "debug/FatalBaseDriver.cpp",
102 "debug/NullGlesDriver.cpp",
103 ],
104 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
105}
106
107cc_defaults {
108 name: "hwui_enable_opengl_validation",
109 defaults: ["hwui_debug"],
110 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700111 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
112}
113
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800114// Build libhwui with PGO by default.
115// Location of PGO profile data is defined in build/soong/cc/pgo.go
116// and is separate from hwui.
117// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
118// or set enable_profile_use property to false.
119cc_defaults {
120 name: "hwui_pgo",
121
122 pgo: {
123 instrumentation: true,
124 profile_file: "hwui/hwui.profdata",
125 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800126 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800127 },
128}
129
Zhizhou Yangf30f1122018-02-26 17:59:38 -0800130// Build hwui library with ThinLTO by default.
131cc_defaults {
132 name: "hwui_lto",
133 target: {
134 android: {
135 lto: {
136 thin: true,
137 },
138 },
139 },
140}
141
Colin Crossf6298102017-04-19 15:25:25 -0700142// ------------------------
143// library
144// ------------------------
145
146cc_defaults {
147 name: "libhwui_defaults",
148 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400149
150 whole_static_libs: ["libskia"],
151
Colin Crossf6298102017-04-19 15:25:25 -0700152 srcs: [
Derek Sollenberger2d142132018-01-22 10:25:26 -0500153 "hwui/AnimatedImageDrawable.cpp",
Leon Scroggins III5b7f4262018-01-26 11:03:54 -0500154 "hwui/AnimatedImageThread.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700155 "hwui/Bitmap.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700156 "hwui/Canvas.cpp",
157 "hwui/MinikinSkia.cpp",
158 "hwui/MinikinUtils.cpp",
159 "hwui/PaintImpl.cpp",
160 "hwui/Typeface.cpp",
161 "pipeline/skia/GLFunctorDrawable.cpp",
162 "pipeline/skia/LayerDrawable.cpp",
163 "pipeline/skia/RenderNodeDrawable.cpp",
164 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400165 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700166 "pipeline/skia/SkiaDisplayList.cpp",
Derek Sollenberger0057db22018-03-29 14:18:44 -0400167 "pipeline/skia/SkiaMemoryTracer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700168 "pipeline/skia/SkiaOpenGLPipeline.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700169 "pipeline/skia/SkiaPipeline.cpp",
170 "pipeline/skia/SkiaProfileRenderer.cpp",
171 "pipeline/skia/SkiaRecordingCanvas.cpp",
172 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400173 "pipeline/skia/VectorDrawableAtlas.cpp",
Chris Blume41423392018-11-06 11:47:03 -0800174 "pipeline/skia/VkFunctorDrawable.cpp",
Chris Blume5f1ac2b2018-11-05 16:10:39 -0800175 "pipeline/skia/VkInteropFunctorDrawable.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700176 "renderstate/RenderState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400177 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700178 "renderthread/CanvasContext.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700179 "renderthread/DrawFrameTask.cpp",
180 "renderthread/EglManager.cpp",
John Reck848f6512018-12-03 13:26:43 -0800181 "renderthread/ReliableSurface.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700182 "renderthread/VulkanManager.cpp",
183 "renderthread/RenderProxy.cpp",
184 "renderthread/RenderTask.cpp",
185 "renderthread/RenderThread.cpp",
186 "renderthread/TimeLord.cpp",
187 "renderthread/Frame.cpp",
188 "service/GraphicsStatsService.cpp",
Stan Iliev564ca3e2018-09-04 22:00:00 +0000189 "surfacetexture/EGLConsumer.cpp",
190 "surfacetexture/ImageConsumer.cpp",
191 "surfacetexture/SurfaceTexture.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700192 "thread/TaskManager.cpp",
193 "utils/Blur.cpp",
194 "utils/Color.cpp",
195 "utils/GLUtils.cpp",
196 "utils/LinearAllocator.cpp",
197 "utils/StringUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700198 "utils/VectorDrawableUtils.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700199 "AnimationContext.cpp",
200 "Animator.cpp",
201 "AnimatorManager.cpp",
John Reck9ce2bf72018-07-02 18:33:32 -0700202 "CanvasTransform.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700203 "DamageAccumulator.cpp",
204 "DeferredLayerUpdater.cpp",
205 "DeviceInfo.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700206 "FrameInfo.cpp",
207 "FrameInfoVisualizer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700208 "GpuMemoryTracker.cpp",
John Recke170fb62018-05-07 08:12:07 -0700209 "HardwareBitmapUploader.cpp",
Stan Ilievb8811aa52018-11-08 16:25:54 -0500210 "HWUIProperties.sysprop",
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",
John Reck283bb462018-12-13 16:40:14 -0800228 "WebViewFunctorManager.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",
John Reck283bb462018-12-13 16:40:14 -0800333 "tests/unit/WebViewFunctorManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700334 ],
335}
336
337// ------------------------
338// Macro-bench app
339// ------------------------
340
341cc_benchmark {
342 name: "hwuimacro",
343 defaults: ["hwui_test_defaults"],
344
345 // set to libhwui_static_debug to skip actual GL commands
346 whole_static_libs: ["libhwui"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800347 shared_libs: [
348 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800349 ],
Colin Crossf6298102017-04-19 15:25:25 -0700350
351 srcs: [
352 "tests/macrobench/TestSceneRunner.cpp",
353 "tests/macrobench/main.cpp",
354 ],
355}
356
357// ------------------------
358// Micro-bench app
359// ---------------------
360
361cc_benchmark {
362 name: "hwuimicro",
363 defaults: ["hwui_test_defaults"],
364
365 cflags: [
366 "-include debug/wrap_gles.h",
367 "-DHWUI_NULL_GPU",
368 ],
369
370 whole_static_libs: ["libhwui_static_debug"],
Tej Singhbb8554a2018-01-26 11:59:14 -0800371 shared_libs: [
372 "libmemunreachable",
Tej Singhbb8554a2018-01-26 11:59:14 -0800373 ],
Colin Crossf6298102017-04-19 15:25:25 -0700374
375 srcs: [
376 "tests/microbench/main.cpp",
377 "tests/microbench/DisplayListCanvasBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700378 "tests/microbench/LinearAllocatorBench.cpp",
379 "tests/microbench/PathParserBench.cpp",
380 "tests/microbench/RenderNodeBench.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700381 "tests/microbench/TaskManagerBench.cpp",
382 ],
383}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800384
385// ----------------------------------------
386// Phony target to build benchmarks for PGO
387// ----------------------------------------
388
389phony {
390 name: "pgo-targets-hwui",
391 required: [
392 "hwuimicro",
393 "hwuimacro",
394 ]
395}