blob: ad6ce2c4a9d60c28229347c3ba8bd19f86472206 [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.
258 // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable.
259 pgo: {
260 instrumentation: true,
261 profile_file: "hwui/hwui.profdata",
262 benchmarks: ["hwui"],
263 },
Colin Crossf6298102017-04-19 15:25:25 -0700264}
265
266// ------------------------
267// static library null gpu
268// ------------------------
269
270cc_library_static {
271 name: "libhwui_static_debug",
272 defaults: [
273 "libhwui_defaults",
274 "hwui_debug",
275 ],
276 cflags: ["-DHWUI_NULL_GPU"],
277 srcs: [
278 "debug/nullegl.cpp",
279 ],
Colin Crossf6298102017-04-19 15:25:25 -0700280}
281
282cc_defaults {
283 name: "hwui_test_defaults",
284 defaults: ["hwui_defaults"],
285 test_suites: ["device-tests"],
286 srcs: [
287 "tests/common/scenes/*.cpp",
288 "tests/common/LeakChecker.cpp",
289 "tests/common/TestListViewSceneBase.cpp",
290 "tests/common/TestContext.cpp",
291 "tests/common/TestScene.cpp",
292 "tests/common/TestUtils.cpp",
293 ],
294}
295
296// ------------------------
297// unit tests
298// ------------------------
299
300cc_test {
301 name: "hwui_unit_tests",
302 defaults: ["hwui_test_defaults"],
303
304 static_libs: [
305 "libgmock",
306 "libhwui_static_debug",
307 ],
308 shared_libs: ["libmemunreachable"],
309 cflags: [
310 "-include debug/wrap_gles.h",
311 "-DHWUI_NULL_GPU",
312 ],
313
314 srcs: [
315 "tests/unit/main.cpp",
316 "tests/unit/BakedOpDispatcherTests.cpp",
317 "tests/unit/BakedOpRendererTests.cpp",
318 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400319 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700320 "tests/unit/CanvasContextTests.cpp",
321 "tests/unit/CanvasStateTests.cpp",
322 "tests/unit/ClipAreaTests.cpp",
323 "tests/unit/DamageAccumulatorTests.cpp",
324 "tests/unit/DeferredLayerUpdaterTests.cpp",
325 "tests/unit/DeviceInfoTests.cpp",
326 "tests/unit/FatVectorTests.cpp",
327 "tests/unit/FontRendererTests.cpp",
328 "tests/unit/FrameBuilderTests.cpp",
329 "tests/unit/GlopBuilderTests.cpp",
330 "tests/unit/GpuMemoryTrackerTests.cpp",
331 "tests/unit/GradientCacheTests.cpp",
332 "tests/unit/GraphicsStatsServiceTests.cpp",
333 "tests/unit/LayerUpdateQueueTests.cpp",
334 "tests/unit/LeakCheckTests.cpp",
335 "tests/unit/LinearAllocatorTests.cpp",
336 "tests/unit/MatrixTests.cpp",
337 "tests/unit/MeshStateTests.cpp",
338 "tests/unit/OffscreenBufferPoolTests.cpp",
339 "tests/unit/OpDumperTests.cpp",
340 "tests/unit/PathInterpolatorTests.cpp",
341 "tests/unit/RenderNodeDrawableTests.cpp",
342 "tests/unit/RecordingCanvasTests.cpp",
343 "tests/unit/RenderNodeTests.cpp",
344 "tests/unit/RenderPropertiesTests.cpp",
345 "tests/unit/SkiaBehaviorTests.cpp",
346 "tests/unit/SkiaDisplayListTests.cpp",
347 "tests/unit/SkiaPipelineTests.cpp",
348 "tests/unit/SkiaRenderPropertiesTests.cpp",
349 "tests/unit/SkiaCanvasTests.cpp",
350 "tests/unit/SnapshotTests.cpp",
351 "tests/unit/StringUtilsTests.cpp",
352 "tests/unit/TestUtilsTests.cpp",
353 "tests/unit/TextDropShadowCacheTests.cpp",
354 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700355 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700356 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400357 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700358 ],
359}
360
361// ------------------------
362// Macro-bench app
363// ------------------------
364
365cc_benchmark {
366 name: "hwuimacro",
367 defaults: ["hwui_test_defaults"],
368
369 // set to libhwui_static_debug to skip actual GL commands
370 whole_static_libs: ["libhwui"],
371 shared_libs: ["libmemunreachable"],
372
373 srcs: [
374 "tests/macrobench/TestSceneRunner.cpp",
375 "tests/macrobench/main.cpp",
376 ],
377}
378
379// ------------------------
380// Micro-bench app
381// ---------------------
382
383cc_benchmark {
384 name: "hwuimicro",
385 defaults: ["hwui_test_defaults"],
386
387 cflags: [
388 "-include debug/wrap_gles.h",
389 "-DHWUI_NULL_GPU",
390 ],
391
392 whole_static_libs: ["libhwui_static_debug"],
393 shared_libs: ["libmemunreachable"],
394
395 srcs: [
396 "tests/microbench/main.cpp",
397 "tests/microbench/DisplayListCanvasBench.cpp",
398 "tests/microbench/FontBench.cpp",
399 "tests/microbench/FrameBuilderBench.cpp",
400 "tests/microbench/LinearAllocatorBench.cpp",
401 "tests/microbench/PathParserBench.cpp",
402 "tests/microbench/RenderNodeBench.cpp",
403 "tests/microbench/ShadowBench.cpp",
404 "tests/microbench/TaskManagerBench.cpp",
405 ],
406}