blob: 7cacaf6a16ad2ee7a24167b846252b3a298ab0a1 [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",
Colin Crossf6298102017-04-19 15:25:25 -07009 ],
10
John Reckf8441e62017-10-23 13:10:41 -070011 cpp_std: "c++17",
12
Colin Crossf6298102017-04-19 15:25:25 -070013 cflags: [
14 "-DEGL_EGLEXT_PROTOTYPES",
15 "-DGL_GLEXT_PROTOTYPES",
16 "-DATRACE_TAG=ATRACE_TAG_VIEW",
17 "-DLOG_TAG=\"OpenGLRenderer\"",
18 "-Wall",
19 "-Wno-unused-parameter",
20 "-Wunreachable-code",
21 "-Werror",
22 "-fvisibility=hidden",
23
24 // GCC false-positives on this warning, and since we -Werror that's
25 // a problem
26 "-Wno-free-nonheap-object",
27
28 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
29 "-Wno-missing-braces",
30
31 // TODO: Linear blending should be enabled by default, but we are
32 // TODO: making it an opt-in while it's a work in progress
33 //"-DANDROID_ENABLE_LINEAR_BLENDING",
34 ],
35
36 include_dirs: [
37 "external/skia/include/private",
38 "external/skia/src/core",
39 "external/skia/src/effects",
40 "external/skia/src/image",
41 "external/skia/src/utils",
Stan Iliev3310fb12017-03-23 16:56:51 -040042 "external/skia/src/gpu",
Colin Crossf6298102017-04-19 15:25:25 -070043 ],
44
45 product_variables: {
46 device_uses_hwc2: {
47 cflags: ["-DUSE_HWC2"],
48 },
49 },
50}
51
52cc_defaults {
53 name: "hwui_static_deps",
54 shared_libs: [
55 "liblog",
56 "libcutils",
57 "libutils",
58 "libEGL",
59 "libGLESv2",
60 "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",
68 "libRScpp",
69 ],
70 static_libs: [
71 "libplatformprotos",
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",
78 srcs: ["font/FontCacheHistoryTracker.cpp"],
79 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
80}
81
82cc_defaults {
83 name: "hwui_compile_for_perf",
84 // TODO: Non-arm?
85 cflags: [
86 "-fno-omit-frame-pointer",
87 "-marm",
88 "-mapcs",
89 ],
90}
91
92cc_defaults {
93 name: "hwui_debug",
94 cflags: ["-include debug/wrap_gles.h"],
95 srcs: [
96 "debug/wrap_gles.cpp",
97 "debug/DefaultGlesDriver.cpp",
98 "debug/GlesErrorCheckWrapper.cpp",
99 "debug/GlesDriver.cpp",
100 "debug/FatalBaseDriver.cpp",
101 "debug/NullGlesDriver.cpp",
102 ],
103 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
104}
105
106cc_defaults {
107 name: "hwui_enable_opengl_validation",
108 defaults: ["hwui_debug"],
109 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700110 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
111}
112
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800113// Build libhwui with PGO by default.
114// Location of PGO profile data is defined in build/soong/cc/pgo.go
115// and is separate from hwui.
116// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
117// or set enable_profile_use property to false.
118cc_defaults {
119 name: "hwui_pgo",
120
121 pgo: {
122 instrumentation: true,
123 profile_file: "hwui/hwui.profdata",
124 benchmarks: ["hwui"],
Zhizhou Yang58e1b782017-12-06 16:59:06 -0800125 enable_profile_use: true,
Pirama Arumuga Nainar0dfd4be2017-11-16 22:40:00 -0800126 },
127}
128
Colin Crossf6298102017-04-19 15:25:25 -0700129// ------------------------
130// library
131// ------------------------
132
133cc_defaults {
134 name: "libhwui_defaults",
135 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400136
137 whole_static_libs: ["libskia"],
138
Colin Crossf6298102017-04-19 15:25:25 -0700139 srcs: [
140 "hwui/Bitmap.cpp",
141 "font/CacheTexture.cpp",
142 "font/Font.cpp",
143 "hwui/Canvas.cpp",
144 "hwui/MinikinSkia.cpp",
145 "hwui/MinikinUtils.cpp",
146 "hwui/PaintImpl.cpp",
147 "hwui/Typeface.cpp",
148 "pipeline/skia/GLFunctorDrawable.cpp",
149 "pipeline/skia/LayerDrawable.cpp",
150 "pipeline/skia/RenderNodeDrawable.cpp",
151 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400152 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700153 "pipeline/skia/SkiaDisplayList.cpp",
154 "pipeline/skia/SkiaOpenGLPipeline.cpp",
155 "pipeline/skia/SkiaOpenGLReadback.cpp",
156 "pipeline/skia/SkiaPipeline.cpp",
157 "pipeline/skia/SkiaProfileRenderer.cpp",
158 "pipeline/skia/SkiaRecordingCanvas.cpp",
159 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400160 "pipeline/skia/VectorDrawableAtlas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700161 "renderstate/Blend.cpp",
162 "renderstate/MeshState.cpp",
163 "renderstate/OffscreenBufferPool.cpp",
164 "renderstate/PixelBufferState.cpp",
165 "renderstate/RenderState.cpp",
166 "renderstate/Scissor.cpp",
167 "renderstate/Stencil.cpp",
168 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400169 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700170 "renderthread/CanvasContext.cpp",
171 "renderthread/OpenGLPipeline.cpp",
172 "renderthread/DrawFrameTask.cpp",
173 "renderthread/EglManager.cpp",
174 "renderthread/VulkanManager.cpp",
175 "renderthread/RenderProxy.cpp",
176 "renderthread/RenderTask.cpp",
177 "renderthread/RenderThread.cpp",
178 "renderthread/TimeLord.cpp",
179 "renderthread/Frame.cpp",
180 "service/GraphicsStatsService.cpp",
181 "thread/TaskManager.cpp",
182 "utils/Blur.cpp",
183 "utils/Color.cpp",
184 "utils/GLUtils.cpp",
185 "utils/LinearAllocator.cpp",
186 "utils/StringUtils.cpp",
187 "utils/TestWindowContext.cpp",
188 "utils/VectorDrawableUtils.cpp",
189 "AmbientShadow.cpp",
190 "AnimationContext.cpp",
191 "Animator.cpp",
192 "AnimatorManager.cpp",
193 "BakedOpDispatcher.cpp",
194 "BakedOpRenderer.cpp",
195 "BakedOpState.cpp",
196 "Caches.cpp",
197 "CanvasState.cpp",
198 "ClipArea.cpp",
199 "DamageAccumulator.cpp",
200 "DeferredLayerUpdater.cpp",
201 "DeviceInfo.cpp",
202 "DisplayList.cpp",
203 "Extensions.cpp",
204 "FboCache.cpp",
205 "FontRenderer.cpp",
206 "FrameBuilder.cpp",
207 "FrameInfo.cpp",
208 "FrameInfoVisualizer.cpp",
209 "GammaFontRenderer.cpp",
210 "GlLayer.cpp",
211 "GlopBuilder.cpp",
212 "GpuMemoryTracker.cpp",
213 "GradientCache.cpp",
214 "Image.cpp",
215 "Interpolator.cpp",
216 "JankTracker.cpp",
217 "Layer.cpp",
218 "LayerBuilder.cpp",
219 "LayerUpdateQueue.cpp",
220 "Matrix.cpp",
221 "OpDumper.cpp",
222 "OpenGLReadback.cpp",
223 "Patch.cpp",
224 "PatchCache.cpp",
225 "PathCache.cpp",
226 "PathParser.cpp",
227 "PathTessellator.cpp",
228 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700229 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700230 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700231 "ProfileRenderer.cpp",
232 "Program.cpp",
233 "ProgramCache.cpp",
234 "Properties.cpp",
235 "PropertyValuesAnimatorSet.cpp",
236 "PropertyValuesHolder.cpp",
237 "RecordingCanvas.cpp",
238 "RenderBufferCache.cpp",
239 "RenderNode.cpp",
240 "RenderProperties.cpp",
241 "ResourceCache.cpp",
242 "ShadowTessellator.cpp",
243 "SkiaCanvas.cpp",
244 "SkiaCanvasProxy.cpp",
245 "SkiaShader.cpp",
246 "Snapshot.cpp",
247 "SpotShadow.cpp",
248 "TessellationCache.cpp",
249 "TextDropShadowCache.cpp",
250 "Texture.cpp",
251 "TextureCache.cpp",
252 "VectorDrawable.cpp",
253 "VkLayer.cpp",
254 "protos/hwui.proto",
255 ],
256
257 proto: {
258 export_proto_headers: true,
259 },
260
261 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700262 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700263}
264
265cc_library {
266 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700267 defaults: [
268 "libhwui_defaults",
269
270 // Enables fine-grained GLES error checking
271 // If enabled, every GLES call is wrapped & error checked
272 // Has moderate overhead
273 "hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700274 ],
Colin Crossf6298102017-04-19 15:25:25 -0700275}
276
277// ------------------------
278// static library null gpu
279// ------------------------
280
281cc_library_static {
282 name: "libhwui_static_debug",
283 defaults: [
284 "libhwui_defaults",
285 "hwui_debug",
286 ],
287 cflags: ["-DHWUI_NULL_GPU"],
288 srcs: [
289 "debug/nullegl.cpp",
290 ],
Colin Crossf6298102017-04-19 15:25:25 -0700291}
292
293cc_defaults {
294 name: "hwui_test_defaults",
295 defaults: ["hwui_defaults"],
296 test_suites: ["device-tests"],
297 srcs: [
298 "tests/common/scenes/*.cpp",
299 "tests/common/LeakChecker.cpp",
300 "tests/common/TestListViewSceneBase.cpp",
301 "tests/common/TestContext.cpp",
302 "tests/common/TestScene.cpp",
303 "tests/common/TestUtils.cpp",
304 ],
305}
306
307// ------------------------
308// unit tests
309// ------------------------
310
311cc_test {
312 name: "hwui_unit_tests",
313 defaults: ["hwui_test_defaults"],
314
315 static_libs: [
316 "libgmock",
317 "libhwui_static_debug",
318 ],
319 shared_libs: ["libmemunreachable"],
320 cflags: [
321 "-include debug/wrap_gles.h",
322 "-DHWUI_NULL_GPU",
323 ],
324
325 srcs: [
326 "tests/unit/main.cpp",
327 "tests/unit/BakedOpDispatcherTests.cpp",
328 "tests/unit/BakedOpRendererTests.cpp",
329 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400330 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700331 "tests/unit/CanvasContextTests.cpp",
332 "tests/unit/CanvasStateTests.cpp",
333 "tests/unit/ClipAreaTests.cpp",
334 "tests/unit/DamageAccumulatorTests.cpp",
335 "tests/unit/DeferredLayerUpdaterTests.cpp",
336 "tests/unit/DeviceInfoTests.cpp",
337 "tests/unit/FatVectorTests.cpp",
338 "tests/unit/FontRendererTests.cpp",
339 "tests/unit/FrameBuilderTests.cpp",
340 "tests/unit/GlopBuilderTests.cpp",
341 "tests/unit/GpuMemoryTrackerTests.cpp",
342 "tests/unit/GradientCacheTests.cpp",
343 "tests/unit/GraphicsStatsServiceTests.cpp",
344 "tests/unit/LayerUpdateQueueTests.cpp",
345 "tests/unit/LeakCheckTests.cpp",
346 "tests/unit/LinearAllocatorTests.cpp",
347 "tests/unit/MatrixTests.cpp",
348 "tests/unit/MeshStateTests.cpp",
349 "tests/unit/OffscreenBufferPoolTests.cpp",
350 "tests/unit/OpDumperTests.cpp",
351 "tests/unit/PathInterpolatorTests.cpp",
352 "tests/unit/RenderNodeDrawableTests.cpp",
353 "tests/unit/RecordingCanvasTests.cpp",
354 "tests/unit/RenderNodeTests.cpp",
355 "tests/unit/RenderPropertiesTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400356 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700357 "tests/unit/SkiaBehaviorTests.cpp",
358 "tests/unit/SkiaDisplayListTests.cpp",
359 "tests/unit/SkiaPipelineTests.cpp",
360 "tests/unit/SkiaRenderPropertiesTests.cpp",
361 "tests/unit/SkiaCanvasTests.cpp",
362 "tests/unit/SnapshotTests.cpp",
363 "tests/unit/StringUtilsTests.cpp",
364 "tests/unit/TestUtilsTests.cpp",
365 "tests/unit/TextDropShadowCacheTests.cpp",
366 "tests/unit/TextureCacheTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700367 "tests/unit/ThreadBaseTests.cpp",
368 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700369 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400370 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700371 ],
372}
373
374// ------------------------
375// Macro-bench app
376// ------------------------
377
378cc_benchmark {
379 name: "hwuimacro",
380 defaults: ["hwui_test_defaults"],
381
382 // set to libhwui_static_debug to skip actual GL commands
383 whole_static_libs: ["libhwui"],
384 shared_libs: ["libmemunreachable"],
385
386 srcs: [
387 "tests/macrobench/TestSceneRunner.cpp",
388 "tests/macrobench/main.cpp",
389 ],
390}
391
392// ------------------------
393// Micro-bench app
394// ---------------------
395
396cc_benchmark {
397 name: "hwuimicro",
398 defaults: ["hwui_test_defaults"],
399
400 cflags: [
401 "-include debug/wrap_gles.h",
402 "-DHWUI_NULL_GPU",
403 ],
404
405 whole_static_libs: ["libhwui_static_debug"],
406 shared_libs: ["libmemunreachable"],
407
408 srcs: [
409 "tests/microbench/main.cpp",
410 "tests/microbench/DisplayListCanvasBench.cpp",
411 "tests/microbench/FontBench.cpp",
412 "tests/microbench/FrameBuilderBench.cpp",
413 "tests/microbench/LinearAllocatorBench.cpp",
414 "tests/microbench/PathParserBench.cpp",
415 "tests/microbench/RenderNodeBench.cpp",
416 "tests/microbench/ShadowBench.cpp",
417 "tests/microbench/TaskManagerBench.cpp",
418 ],
419}
Pirama Arumuga Nainarbc1e1772017-11-17 11:32:16 -0800420
421// ----------------------------------------
422// Phony target to build benchmarks for PGO
423// ----------------------------------------
424
425phony {
426 name: "pgo-targets-hwui",
427 required: [
428 "hwuimicro",
429 "hwuimacro",
430 ]
431}