blob: 24ce1e4c23d01974817b8ba24841910281b07e71 [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -04005 "skia_deps"
Colin Crossf6298102017-04-19 15:25:25 -07006 //"hwui_bugreport_font_cache_usage",
7 //"hwui_compile_for_perf",
Colin Crossf6298102017-04-19 15:25:25 -07008 ],
9
John Reckf8441e62017-10-23 13:10:41 -070010 cpp_std: "c++17",
11
Colin Crossf6298102017-04-19 15:25:25 -070012 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",
Colin Crossf6298102017-04-19 15:25:25 -070042 ],
43
44 product_variables: {
45 device_uses_hwc2: {
46 cflags: ["-DUSE_HWC2"],
47 },
48 },
49}
50
51cc_defaults {
52 name: "hwui_static_deps",
53 shared_libs: [
54 "liblog",
55 "libcutils",
56 "libutils",
57 "libEGL",
58 "libGLESv2",
59 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070060 "libui",
61 "libgui",
John Reck915883b2017-05-03 10:27:20 -070062 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070063 "libharfbuzz_ng",
64 "libft2",
65 "libminikin",
66 "libandroidfw",
67 "libRScpp",
68 ],
69 static_libs: [
70 "libplatformprotos",
Stan Ilievd495f432017-10-09 15:49:32 -040071 "libEGL_blobCache",
Colin Crossf6298102017-04-19 15:25:25 -070072 ],
73}
74
75cc_defaults {
76 name: "hwui_bugreport_font_cache_usage",
77 srcs: ["font/FontCacheHistoryTracker.cpp"],
78 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
79}
80
81cc_defaults {
82 name: "hwui_compile_for_perf",
83 // TODO: Non-arm?
84 cflags: [
85 "-fno-omit-frame-pointer",
86 "-marm",
87 "-mapcs",
88 ],
89}
90
91cc_defaults {
92 name: "hwui_debug",
93 cflags: ["-include debug/wrap_gles.h"],
94 srcs: [
95 "debug/wrap_gles.cpp",
96 "debug/DefaultGlesDriver.cpp",
97 "debug/GlesErrorCheckWrapper.cpp",
98 "debug/GlesDriver.cpp",
99 "debug/FatalBaseDriver.cpp",
100 "debug/NullGlesDriver.cpp",
101 ],
102 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
103}
104
105cc_defaults {
106 name: "hwui_enable_opengl_validation",
107 defaults: ["hwui_debug"],
108 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700109 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
110}
111
112// ------------------------
113// library
114// ------------------------
115
116cc_defaults {
117 name: "libhwui_defaults",
118 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400119
120 whole_static_libs: ["libskia"],
121
Colin Crossf6298102017-04-19 15:25:25 -0700122 srcs: [
123 "hwui/Bitmap.cpp",
124 "font/CacheTexture.cpp",
125 "font/Font.cpp",
126 "hwui/Canvas.cpp",
127 "hwui/MinikinSkia.cpp",
128 "hwui/MinikinUtils.cpp",
129 "hwui/PaintImpl.cpp",
130 "hwui/Typeface.cpp",
131 "pipeline/skia/GLFunctorDrawable.cpp",
132 "pipeline/skia/LayerDrawable.cpp",
133 "pipeline/skia/RenderNodeDrawable.cpp",
134 "pipeline/skia/ReorderBarrierDrawables.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400135 "pipeline/skia/ShaderCache.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700136 "pipeline/skia/SkiaDisplayList.cpp",
137 "pipeline/skia/SkiaOpenGLPipeline.cpp",
138 "pipeline/skia/SkiaOpenGLReadback.cpp",
139 "pipeline/skia/SkiaPipeline.cpp",
140 "pipeline/skia/SkiaProfileRenderer.cpp",
141 "pipeline/skia/SkiaRecordingCanvas.cpp",
142 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400143 "pipeline/skia/VectorDrawableAtlas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700144 "renderstate/Blend.cpp",
145 "renderstate/MeshState.cpp",
146 "renderstate/OffscreenBufferPool.cpp",
147 "renderstate/PixelBufferState.cpp",
148 "renderstate/RenderState.cpp",
149 "renderstate/Scissor.cpp",
150 "renderstate/Stencil.cpp",
151 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400152 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700153 "renderthread/CanvasContext.cpp",
154 "renderthread/OpenGLPipeline.cpp",
155 "renderthread/DrawFrameTask.cpp",
156 "renderthread/EglManager.cpp",
157 "renderthread/VulkanManager.cpp",
158 "renderthread/RenderProxy.cpp",
159 "renderthread/RenderTask.cpp",
160 "renderthread/RenderThread.cpp",
161 "renderthread/TimeLord.cpp",
162 "renderthread/Frame.cpp",
163 "service/GraphicsStatsService.cpp",
164 "thread/TaskManager.cpp",
165 "utils/Blur.cpp",
166 "utils/Color.cpp",
167 "utils/GLUtils.cpp",
168 "utils/LinearAllocator.cpp",
169 "utils/StringUtils.cpp",
170 "utils/TestWindowContext.cpp",
171 "utils/VectorDrawableUtils.cpp",
172 "AmbientShadow.cpp",
173 "AnimationContext.cpp",
174 "Animator.cpp",
175 "AnimatorManager.cpp",
176 "BakedOpDispatcher.cpp",
177 "BakedOpRenderer.cpp",
178 "BakedOpState.cpp",
179 "Caches.cpp",
180 "CanvasState.cpp",
181 "ClipArea.cpp",
182 "DamageAccumulator.cpp",
183 "DeferredLayerUpdater.cpp",
184 "DeviceInfo.cpp",
185 "DisplayList.cpp",
186 "Extensions.cpp",
187 "FboCache.cpp",
188 "FontRenderer.cpp",
189 "FrameBuilder.cpp",
190 "FrameInfo.cpp",
191 "FrameInfoVisualizer.cpp",
192 "GammaFontRenderer.cpp",
193 "GlLayer.cpp",
194 "GlopBuilder.cpp",
195 "GpuMemoryTracker.cpp",
196 "GradientCache.cpp",
197 "Image.cpp",
198 "Interpolator.cpp",
199 "JankTracker.cpp",
200 "Layer.cpp",
201 "LayerBuilder.cpp",
202 "LayerUpdateQueue.cpp",
203 "Matrix.cpp",
204 "OpDumper.cpp",
205 "OpenGLReadback.cpp",
206 "Patch.cpp",
207 "PatchCache.cpp",
208 "PathCache.cpp",
209 "PathParser.cpp",
210 "PathTessellator.cpp",
211 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700212 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700213 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700214 "ProfileRenderer.cpp",
215 "Program.cpp",
216 "ProgramCache.cpp",
217 "Properties.cpp",
218 "PropertyValuesAnimatorSet.cpp",
219 "PropertyValuesHolder.cpp",
220 "RecordingCanvas.cpp",
221 "RenderBufferCache.cpp",
222 "RenderNode.cpp",
223 "RenderProperties.cpp",
224 "ResourceCache.cpp",
225 "ShadowTessellator.cpp",
226 "SkiaCanvas.cpp",
227 "SkiaCanvasProxy.cpp",
228 "SkiaShader.cpp",
229 "Snapshot.cpp",
230 "SpotShadow.cpp",
231 "TessellationCache.cpp",
232 "TextDropShadowCache.cpp",
233 "Texture.cpp",
234 "TextureCache.cpp",
235 "VectorDrawable.cpp",
236 "VkLayer.cpp",
237 "protos/hwui.proto",
238 ],
239
240 proto: {
241 export_proto_headers: true,
242 },
243
244 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700245 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700246}
247
248cc_library {
249 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700250 defaults: [
251 "libhwui_defaults",
252
253 // Enables fine-grained GLES error checking
254 // If enabled, every GLES call is wrapped & error checked
255 // Has moderate overhead
256 "hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700257 ],
258
259 // Build libhwui with PGO by default.
260 // Location of PGO profile data is defined in build/soong/cc/pgo.go
261 // and is separate from hwui.
Zhizhou Yangded60352017-10-17 13:37:00 -0700262 // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
263 // or set enable_profile_use property to false.
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700264 pgo: {
265 instrumentation: true,
266 profile_file: "hwui/hwui.profdata",
267 benchmarks: ["hwui"],
Zhizhou Yangded60352017-10-17 13:37:00 -0700268 enable_profile_use: false,
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700269 },
Colin Crossf6298102017-04-19 15:25:25 -0700270}
271
272// ------------------------
273// static library null gpu
274// ------------------------
275
276cc_library_static {
277 name: "libhwui_static_debug",
278 defaults: [
279 "libhwui_defaults",
280 "hwui_debug",
281 ],
282 cflags: ["-DHWUI_NULL_GPU"],
283 srcs: [
284 "debug/nullegl.cpp",
285 ],
Colin Crossf6298102017-04-19 15:25:25 -0700286}
287
288cc_defaults {
289 name: "hwui_test_defaults",
290 defaults: ["hwui_defaults"],
291 test_suites: ["device-tests"],
292 srcs: [
293 "tests/common/scenes/*.cpp",
294 "tests/common/LeakChecker.cpp",
295 "tests/common/TestListViewSceneBase.cpp",
296 "tests/common/TestContext.cpp",
297 "tests/common/TestScene.cpp",
298 "tests/common/TestUtils.cpp",
299 ],
300}
301
302// ------------------------
303// unit tests
304// ------------------------
305
306cc_test {
307 name: "hwui_unit_tests",
308 defaults: ["hwui_test_defaults"],
309
310 static_libs: [
311 "libgmock",
312 "libhwui_static_debug",
313 ],
314 shared_libs: ["libmemunreachable"],
315 cflags: [
316 "-include debug/wrap_gles.h",
317 "-DHWUI_NULL_GPU",
318 ],
319
320 srcs: [
321 "tests/unit/main.cpp",
322 "tests/unit/BakedOpDispatcherTests.cpp",
323 "tests/unit/BakedOpRendererTests.cpp",
324 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400325 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700326 "tests/unit/CanvasContextTests.cpp",
327 "tests/unit/CanvasStateTests.cpp",
328 "tests/unit/ClipAreaTests.cpp",
329 "tests/unit/DamageAccumulatorTests.cpp",
330 "tests/unit/DeferredLayerUpdaterTests.cpp",
331 "tests/unit/DeviceInfoTests.cpp",
332 "tests/unit/FatVectorTests.cpp",
333 "tests/unit/FontRendererTests.cpp",
334 "tests/unit/FrameBuilderTests.cpp",
335 "tests/unit/GlopBuilderTests.cpp",
336 "tests/unit/GpuMemoryTrackerTests.cpp",
337 "tests/unit/GradientCacheTests.cpp",
338 "tests/unit/GraphicsStatsServiceTests.cpp",
339 "tests/unit/LayerUpdateQueueTests.cpp",
340 "tests/unit/LeakCheckTests.cpp",
341 "tests/unit/LinearAllocatorTests.cpp",
342 "tests/unit/MatrixTests.cpp",
343 "tests/unit/MeshStateTests.cpp",
344 "tests/unit/OffscreenBufferPoolTests.cpp",
345 "tests/unit/OpDumperTests.cpp",
346 "tests/unit/PathInterpolatorTests.cpp",
347 "tests/unit/RenderNodeDrawableTests.cpp",
348 "tests/unit/RecordingCanvasTests.cpp",
349 "tests/unit/RenderNodeTests.cpp",
350 "tests/unit/RenderPropertiesTests.cpp",
Stan Ilievd495f432017-10-09 15:49:32 -0400351 "tests/unit/ShaderCacheTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700352 "tests/unit/SkiaBehaviorTests.cpp",
353 "tests/unit/SkiaDisplayListTests.cpp",
354 "tests/unit/SkiaPipelineTests.cpp",
355 "tests/unit/SkiaRenderPropertiesTests.cpp",
356 "tests/unit/SkiaCanvasTests.cpp",
357 "tests/unit/SnapshotTests.cpp",
358 "tests/unit/StringUtilsTests.cpp",
359 "tests/unit/TestUtilsTests.cpp",
360 "tests/unit/TextDropShadowCacheTests.cpp",
361 "tests/unit/TextureCacheTests.cpp",
John Reckf8441e62017-10-23 13:10:41 -0700362 "tests/unit/ThreadBaseTests.cpp",
363 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700364 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400365 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700366 ],
367}
368
369// ------------------------
370// Macro-bench app
371// ------------------------
372
373cc_benchmark {
374 name: "hwuimacro",
375 defaults: ["hwui_test_defaults"],
376
377 // set to libhwui_static_debug to skip actual GL commands
378 whole_static_libs: ["libhwui"],
379 shared_libs: ["libmemunreachable"],
380
381 srcs: [
382 "tests/macrobench/TestSceneRunner.cpp",
383 "tests/macrobench/main.cpp",
384 ],
385}
386
387// ------------------------
388// Micro-bench app
389// ---------------------
390
391cc_benchmark {
392 name: "hwuimicro",
393 defaults: ["hwui_test_defaults"],
394
395 cflags: [
396 "-include debug/wrap_gles.h",
397 "-DHWUI_NULL_GPU",
398 ],
399
400 whole_static_libs: ["libhwui_static_debug"],
401 shared_libs: ["libmemunreachable"],
402
403 srcs: [
404 "tests/microbench/main.cpp",
405 "tests/microbench/DisplayListCanvasBench.cpp",
406 "tests/microbench/FontBench.cpp",
407 "tests/microbench/FrameBuilderBench.cpp",
408 "tests/microbench/LinearAllocatorBench.cpp",
409 "tests/microbench/PathParserBench.cpp",
410 "tests/microbench/RenderNodeBench.cpp",
411 "tests/microbench/ShadowBench.cpp",
412 "tests/microbench/TaskManagerBench.cpp",
413 ],
414}