blob: 40aecac5e27d647517e9ce8d725adee3bc30db0b [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
10 cflags: [
11 "-DEGL_EGLEXT_PROTOTYPES",
12 "-DGL_GLEXT_PROTOTYPES",
13 "-DATRACE_TAG=ATRACE_TAG_VIEW",
14 "-DLOG_TAG=\"OpenGLRenderer\"",
15 "-Wall",
16 "-Wno-unused-parameter",
17 "-Wunreachable-code",
18 "-Werror",
19 "-fvisibility=hidden",
20
21 // GCC false-positives on this warning, and since we -Werror that's
22 // a problem
23 "-Wno-free-nonheap-object",
24
25 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
26 "-Wno-missing-braces",
27
28 // TODO: Linear blending should be enabled by default, but we are
29 // TODO: making it an opt-in while it's a work in progress
30 //"-DANDROID_ENABLE_LINEAR_BLENDING",
31 ],
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",
Colin Crossf6298102017-04-19 15:25:25 -070040 ],
41
42 product_variables: {
43 device_uses_hwc2: {
44 cflags: ["-DUSE_HWC2"],
45 },
46 },
47}
48
49cc_defaults {
50 name: "hwui_static_deps",
51 shared_libs: [
52 "liblog",
53 "libcutils",
54 "libutils",
55 "libEGL",
56 "libGLESv2",
57 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070058 "libui",
59 "libgui",
John Reck915883b2017-05-03 10:27:20 -070060 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070061 "libharfbuzz_ng",
62 "libft2",
63 "libminikin",
64 "libandroidfw",
65 "libRScpp",
66 ],
67 static_libs: [
68 "libplatformprotos",
69 ],
70}
71
72cc_defaults {
73 name: "hwui_bugreport_font_cache_usage",
74 srcs: ["font/FontCacheHistoryTracker.cpp"],
75 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
76}
77
78cc_defaults {
79 name: "hwui_compile_for_perf",
80 // TODO: Non-arm?
81 cflags: [
82 "-fno-omit-frame-pointer",
83 "-marm",
84 "-mapcs",
85 ],
86}
87
88cc_defaults {
89 name: "hwui_debug",
90 cflags: ["-include debug/wrap_gles.h"],
91 srcs: [
92 "debug/wrap_gles.cpp",
93 "debug/DefaultGlesDriver.cpp",
94 "debug/GlesErrorCheckWrapper.cpp",
95 "debug/GlesDriver.cpp",
96 "debug/FatalBaseDriver.cpp",
97 "debug/NullGlesDriver.cpp",
98 ],
99 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
100}
101
102cc_defaults {
103 name: "hwui_enable_opengl_validation",
104 defaults: ["hwui_debug"],
105 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700106 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
107}
108
109// ------------------------
110// library
111// ------------------------
112
113cc_defaults {
114 name: "libhwui_defaults",
115 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400116
117 whole_static_libs: ["libskia"],
118
Colin Crossf6298102017-04-19 15:25:25 -0700119 srcs: [
120 "hwui/Bitmap.cpp",
121 "font/CacheTexture.cpp",
122 "font/Font.cpp",
123 "hwui/Canvas.cpp",
124 "hwui/MinikinSkia.cpp",
125 "hwui/MinikinUtils.cpp",
126 "hwui/PaintImpl.cpp",
127 "hwui/Typeface.cpp",
128 "pipeline/skia/GLFunctorDrawable.cpp",
129 "pipeline/skia/LayerDrawable.cpp",
130 "pipeline/skia/RenderNodeDrawable.cpp",
131 "pipeline/skia/ReorderBarrierDrawables.cpp",
132 "pipeline/skia/SkiaDisplayList.cpp",
133 "pipeline/skia/SkiaOpenGLPipeline.cpp",
134 "pipeline/skia/SkiaOpenGLReadback.cpp",
135 "pipeline/skia/SkiaPipeline.cpp",
136 "pipeline/skia/SkiaProfileRenderer.cpp",
137 "pipeline/skia/SkiaRecordingCanvas.cpp",
138 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400139 "pipeline/skia/VectorDrawableAtlas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700140 "renderstate/Blend.cpp",
141 "renderstate/MeshState.cpp",
142 "renderstate/OffscreenBufferPool.cpp",
143 "renderstate/PixelBufferState.cpp",
144 "renderstate/RenderState.cpp",
145 "renderstate/Scissor.cpp",
146 "renderstate/Stencil.cpp",
147 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400148 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700149 "renderthread/CanvasContext.cpp",
150 "renderthread/OpenGLPipeline.cpp",
151 "renderthread/DrawFrameTask.cpp",
152 "renderthread/EglManager.cpp",
153 "renderthread/VulkanManager.cpp",
154 "renderthread/RenderProxy.cpp",
155 "renderthread/RenderTask.cpp",
156 "renderthread/RenderThread.cpp",
157 "renderthread/TimeLord.cpp",
158 "renderthread/Frame.cpp",
159 "service/GraphicsStatsService.cpp",
160 "thread/TaskManager.cpp",
161 "utils/Blur.cpp",
162 "utils/Color.cpp",
163 "utils/GLUtils.cpp",
164 "utils/LinearAllocator.cpp",
165 "utils/StringUtils.cpp",
166 "utils/TestWindowContext.cpp",
167 "utils/VectorDrawableUtils.cpp",
168 "AmbientShadow.cpp",
169 "AnimationContext.cpp",
170 "Animator.cpp",
171 "AnimatorManager.cpp",
172 "BakedOpDispatcher.cpp",
173 "BakedOpRenderer.cpp",
174 "BakedOpState.cpp",
175 "Caches.cpp",
176 "CanvasState.cpp",
177 "ClipArea.cpp",
178 "DamageAccumulator.cpp",
179 "DeferredLayerUpdater.cpp",
180 "DeviceInfo.cpp",
181 "DisplayList.cpp",
182 "Extensions.cpp",
183 "FboCache.cpp",
184 "FontRenderer.cpp",
185 "FrameBuilder.cpp",
186 "FrameInfo.cpp",
187 "FrameInfoVisualizer.cpp",
188 "GammaFontRenderer.cpp",
189 "GlLayer.cpp",
190 "GlopBuilder.cpp",
191 "GpuMemoryTracker.cpp",
192 "GradientCache.cpp",
193 "Image.cpp",
194 "Interpolator.cpp",
195 "JankTracker.cpp",
196 "Layer.cpp",
197 "LayerBuilder.cpp",
198 "LayerUpdateQueue.cpp",
199 "Matrix.cpp",
200 "OpDumper.cpp",
201 "OpenGLReadback.cpp",
202 "Patch.cpp",
203 "PatchCache.cpp",
204 "PathCache.cpp",
205 "PathParser.cpp",
206 "PathTessellator.cpp",
207 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700208 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700209 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700210 "ProfileRenderer.cpp",
211 "Program.cpp",
212 "ProgramCache.cpp",
213 "Properties.cpp",
214 "PropertyValuesAnimatorSet.cpp",
215 "PropertyValuesHolder.cpp",
216 "RecordingCanvas.cpp",
217 "RenderBufferCache.cpp",
218 "RenderNode.cpp",
219 "RenderProperties.cpp",
220 "ResourceCache.cpp",
221 "ShadowTessellator.cpp",
222 "SkiaCanvas.cpp",
223 "SkiaCanvasProxy.cpp",
224 "SkiaShader.cpp",
225 "Snapshot.cpp",
226 "SpotShadow.cpp",
227 "TessellationCache.cpp",
228 "TextDropShadowCache.cpp",
229 "Texture.cpp",
230 "TextureCache.cpp",
231 "VectorDrawable.cpp",
232 "VkLayer.cpp",
233 "protos/hwui.proto",
234 ],
235
236 proto: {
237 export_proto_headers: true,
238 },
239
240 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700241 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700242}
243
244cc_library {
245 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700246 defaults: [
247 "libhwui_defaults",
248
249 // Enables fine-grained GLES error checking
250 // If enabled, every GLES call is wrapped & error checked
251 // Has moderate overhead
252 "hwui_enable_opengl_validation",
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700253 ],
254
255 // Build libhwui with PGO by default.
256 // Location of PGO profile data is defined in build/soong/cc/pgo.go
257 // and is separate from hwui.
Zhizhou Yangded60352017-10-17 13:37:00 -0700258 // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable
259 // or set enable_profile_use property to false.
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700260 pgo: {
261 instrumentation: true,
262 profile_file: "hwui/hwui.profdata",
263 benchmarks: ["hwui"],
Zhizhou Yangded60352017-10-17 13:37:00 -0700264 enable_profile_use: false,
Zhizhou Yang17371ec2017-10-13 11:42:13 -0700265 },
Colin Crossf6298102017-04-19 15:25:25 -0700266}
267
268// ------------------------
269// static library null gpu
270// ------------------------
271
272cc_library_static {
273 name: "libhwui_static_debug",
274 defaults: [
275 "libhwui_defaults",
276 "hwui_debug",
277 ],
278 cflags: ["-DHWUI_NULL_GPU"],
279 srcs: [
280 "debug/nullegl.cpp",
281 ],
Colin Crossf6298102017-04-19 15:25:25 -0700282}
283
284cc_defaults {
285 name: "hwui_test_defaults",
286 defaults: ["hwui_defaults"],
287 test_suites: ["device-tests"],
288 srcs: [
289 "tests/common/scenes/*.cpp",
290 "tests/common/LeakChecker.cpp",
291 "tests/common/TestListViewSceneBase.cpp",
292 "tests/common/TestContext.cpp",
293 "tests/common/TestScene.cpp",
294 "tests/common/TestUtils.cpp",
295 ],
296}
297
298// ------------------------
299// unit tests
300// ------------------------
301
302cc_test {
303 name: "hwui_unit_tests",
304 defaults: ["hwui_test_defaults"],
305
306 static_libs: [
307 "libgmock",
308 "libhwui_static_debug",
309 ],
310 shared_libs: ["libmemunreachable"],
311 cflags: [
312 "-include debug/wrap_gles.h",
313 "-DHWUI_NULL_GPU",
314 ],
315
316 srcs: [
317 "tests/unit/main.cpp",
318 "tests/unit/BakedOpDispatcherTests.cpp",
319 "tests/unit/BakedOpRendererTests.cpp",
320 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400321 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700322 "tests/unit/CanvasContextTests.cpp",
323 "tests/unit/CanvasStateTests.cpp",
324 "tests/unit/ClipAreaTests.cpp",
325 "tests/unit/DamageAccumulatorTests.cpp",
326 "tests/unit/DeferredLayerUpdaterTests.cpp",
327 "tests/unit/DeviceInfoTests.cpp",
328 "tests/unit/FatVectorTests.cpp",
329 "tests/unit/FontRendererTests.cpp",
330 "tests/unit/FrameBuilderTests.cpp",
331 "tests/unit/GlopBuilderTests.cpp",
332 "tests/unit/GpuMemoryTrackerTests.cpp",
333 "tests/unit/GradientCacheTests.cpp",
334 "tests/unit/GraphicsStatsServiceTests.cpp",
335 "tests/unit/LayerUpdateQueueTests.cpp",
336 "tests/unit/LeakCheckTests.cpp",
337 "tests/unit/LinearAllocatorTests.cpp",
338 "tests/unit/MatrixTests.cpp",
339 "tests/unit/MeshStateTests.cpp",
340 "tests/unit/OffscreenBufferPoolTests.cpp",
341 "tests/unit/OpDumperTests.cpp",
342 "tests/unit/PathInterpolatorTests.cpp",
343 "tests/unit/RenderNodeDrawableTests.cpp",
344 "tests/unit/RecordingCanvasTests.cpp",
345 "tests/unit/RenderNodeTests.cpp",
346 "tests/unit/RenderPropertiesTests.cpp",
347 "tests/unit/SkiaBehaviorTests.cpp",
348 "tests/unit/SkiaDisplayListTests.cpp",
349 "tests/unit/SkiaPipelineTests.cpp",
350 "tests/unit/SkiaRenderPropertiesTests.cpp",
351 "tests/unit/SkiaCanvasTests.cpp",
352 "tests/unit/SnapshotTests.cpp",
353 "tests/unit/StringUtilsTests.cpp",
354 "tests/unit/TestUtilsTests.cpp",
355 "tests/unit/TextDropShadowCacheTests.cpp",
356 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700357 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700358 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400359 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700360 ],
361}
362
363// ------------------------
364// Macro-bench app
365// ------------------------
366
367cc_benchmark {
368 name: "hwuimacro",
369 defaults: ["hwui_test_defaults"],
370
371 // set to libhwui_static_debug to skip actual GL commands
372 whole_static_libs: ["libhwui"],
373 shared_libs: ["libmemunreachable"],
374
375 srcs: [
376 "tests/macrobench/TestSceneRunner.cpp",
377 "tests/macrobench/main.cpp",
378 ],
379}
380
381// ------------------------
382// Micro-bench app
383// ---------------------
384
385cc_benchmark {
386 name: "hwuimicro",
387 defaults: ["hwui_test_defaults"],
388
389 cflags: [
390 "-include debug/wrap_gles.h",
391 "-DHWUI_NULL_GPU",
392 ],
393
394 whole_static_libs: ["libhwui_static_debug"],
395 shared_libs: ["libmemunreachable"],
396
397 srcs: [
398 "tests/microbench/main.cpp",
399 "tests/microbench/DisplayListCanvasBench.cpp",
400 "tests/microbench/FontBench.cpp",
401 "tests/microbench/FrameBuilderBench.cpp",
402 "tests/microbench/LinearAllocatorBench.cpp",
403 "tests/microbench/PathParserBench.cpp",
404 "tests/microbench/RenderNodeBench.cpp",
405 "tests/microbench/ShadowBench.cpp",
406 "tests/microbench/TaskManagerBench.cpp",
407 ],
408}