blob: c468038d61c294dcf675c3e4824654e2e4ec37b2 [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
5
6 //"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 },
John Reck27294182018-07-11 11:21:09 -070046 eng: {
47 lto: {
48 never: true,
49 },
50 },
Colin Crossf6298102017-04-19 15:25:25 -070051 },
52}
53
54cc_defaults {
55 name: "hwui_static_deps",
56 shared_libs: [
57 "liblog",
58 "libcutils",
59 "libutils",
60 "libEGL",
61 "libGLESv2",
62 "libvulkan",
63 "libskia",
64 "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",
71 "libRScpp",
72 ],
73 static_libs: [
74 "libplatformprotos",
75 ],
76}
77
78cc_defaults {
79 name: "hwui_bugreport_font_cache_usage",
80 srcs: ["font/FontCacheHistoryTracker.cpp"],
81 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
82}
83
84cc_defaults {
85 name: "hwui_compile_for_perf",
86 // TODO: Non-arm?
87 cflags: [
88 "-fno-omit-frame-pointer",
89 "-marm",
90 "-mapcs",
91 ],
92}
93
94cc_defaults {
95 name: "hwui_debug",
96 cflags: ["-include debug/wrap_gles.h"],
97 srcs: [
98 "debug/wrap_gles.cpp",
99 "debug/DefaultGlesDriver.cpp",
100 "debug/GlesErrorCheckWrapper.cpp",
101 "debug/GlesDriver.cpp",
102 "debug/FatalBaseDriver.cpp",
103 "debug/NullGlesDriver.cpp",
104 ],
105 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
106}
107
108cc_defaults {
109 name: "hwui_enable_opengl_validation",
110 defaults: ["hwui_debug"],
111 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700112 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
113}
114
115// ------------------------
116// library
117// ------------------------
118
119cc_defaults {
120 name: "libhwui_defaults",
121 defaults: ["hwui_defaults"],
122 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",
135 "pipeline/skia/SkiaDisplayList.cpp",
136 "pipeline/skia/SkiaOpenGLPipeline.cpp",
137 "pipeline/skia/SkiaOpenGLReadback.cpp",
138 "pipeline/skia/SkiaPipeline.cpp",
139 "pipeline/skia/SkiaProfileRenderer.cpp",
140 "pipeline/skia/SkiaRecordingCanvas.cpp",
141 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400142 "pipeline/skia/VectorDrawableAtlas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700143 "renderstate/Blend.cpp",
144 "renderstate/MeshState.cpp",
145 "renderstate/OffscreenBufferPool.cpp",
146 "renderstate/PixelBufferState.cpp",
147 "renderstate/RenderState.cpp",
148 "renderstate/Scissor.cpp",
149 "renderstate/Stencil.cpp",
150 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400151 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700152 "renderthread/CanvasContext.cpp",
153 "renderthread/OpenGLPipeline.cpp",
154 "renderthread/DrawFrameTask.cpp",
155 "renderthread/EglManager.cpp",
156 "renderthread/VulkanManager.cpp",
157 "renderthread/RenderProxy.cpp",
158 "renderthread/RenderTask.cpp",
159 "renderthread/RenderThread.cpp",
160 "renderthread/TimeLord.cpp",
161 "renderthread/Frame.cpp",
162 "service/GraphicsStatsService.cpp",
163 "thread/TaskManager.cpp",
164 "utils/Blur.cpp",
165 "utils/Color.cpp",
166 "utils/GLUtils.cpp",
167 "utils/LinearAllocator.cpp",
168 "utils/StringUtils.cpp",
169 "utils/TestWindowContext.cpp",
170 "utils/VectorDrawableUtils.cpp",
171 "AmbientShadow.cpp",
172 "AnimationContext.cpp",
173 "Animator.cpp",
174 "AnimatorManager.cpp",
175 "BakedOpDispatcher.cpp",
176 "BakedOpRenderer.cpp",
177 "BakedOpState.cpp",
178 "Caches.cpp",
179 "CanvasState.cpp",
180 "ClipArea.cpp",
181 "DamageAccumulator.cpp",
182 "DeferredLayerUpdater.cpp",
183 "DeviceInfo.cpp",
184 "DisplayList.cpp",
185 "Extensions.cpp",
186 "FboCache.cpp",
187 "FontRenderer.cpp",
188 "FrameBuilder.cpp",
189 "FrameInfo.cpp",
190 "FrameInfoVisualizer.cpp",
191 "GammaFontRenderer.cpp",
192 "GlLayer.cpp",
193 "GlopBuilder.cpp",
194 "GpuMemoryTracker.cpp",
195 "GradientCache.cpp",
196 "Image.cpp",
197 "Interpolator.cpp",
198 "JankTracker.cpp",
199 "Layer.cpp",
200 "LayerBuilder.cpp",
201 "LayerUpdateQueue.cpp",
202 "Matrix.cpp",
203 "OpDumper.cpp",
204 "OpenGLReadback.cpp",
205 "Patch.cpp",
206 "PatchCache.cpp",
207 "PathCache.cpp",
208 "PathParser.cpp",
209 "PathTessellator.cpp",
210 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700211 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700212 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700213 "ProfileRenderer.cpp",
214 "Program.cpp",
215 "ProgramCache.cpp",
216 "Properties.cpp",
217 "PropertyValuesAnimatorSet.cpp",
218 "PropertyValuesHolder.cpp",
219 "RecordingCanvas.cpp",
220 "RenderBufferCache.cpp",
221 "RenderNode.cpp",
222 "RenderProperties.cpp",
223 "ResourceCache.cpp",
224 "ShadowTessellator.cpp",
225 "SkiaCanvas.cpp",
226 "SkiaCanvasProxy.cpp",
227 "SkiaShader.cpp",
228 "Snapshot.cpp",
229 "SpotShadow.cpp",
230 "TessellationCache.cpp",
231 "TextDropShadowCache.cpp",
232 "Texture.cpp",
233 "TextureCache.cpp",
234 "VectorDrawable.cpp",
235 "VkLayer.cpp",
236 "protos/hwui.proto",
237 ],
238
239 proto: {
240 export_proto_headers: true,
241 },
242
243 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700244 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700245}
246
247cc_library {
248 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700249 defaults: [
250 "libhwui_defaults",
251
252 // Enables fine-grained GLES error checking
253 // If enabled, every GLES call is wrapped & error checked
254 // Has moderate overhead
255 "hwui_enable_opengl_validation",
256],
Colin Crossf6298102017-04-19 15:25:25 -0700257}
258
259// ------------------------
260// static library null gpu
261// ------------------------
262
263cc_library_static {
264 name: "libhwui_static_debug",
265 defaults: [
266 "libhwui_defaults",
267 "hwui_debug",
268 ],
269 cflags: ["-DHWUI_NULL_GPU"],
270 srcs: [
271 "debug/nullegl.cpp",
272 ],
Colin Crossf6298102017-04-19 15:25:25 -0700273}
274
275cc_defaults {
276 name: "hwui_test_defaults",
277 defaults: ["hwui_defaults"],
278 test_suites: ["device-tests"],
279 srcs: [
280 "tests/common/scenes/*.cpp",
281 "tests/common/LeakChecker.cpp",
282 "tests/common/TestListViewSceneBase.cpp",
283 "tests/common/TestContext.cpp",
284 "tests/common/TestScene.cpp",
285 "tests/common/TestUtils.cpp",
286 ],
287}
288
289// ------------------------
290// unit tests
291// ------------------------
292
293cc_test {
294 name: "hwui_unit_tests",
295 defaults: ["hwui_test_defaults"],
296
297 static_libs: [
298 "libgmock",
299 "libhwui_static_debug",
300 ],
301 shared_libs: ["libmemunreachable"],
302 cflags: [
303 "-include debug/wrap_gles.h",
304 "-DHWUI_NULL_GPU",
305 ],
306
307 srcs: [
308 "tests/unit/main.cpp",
309 "tests/unit/BakedOpDispatcherTests.cpp",
310 "tests/unit/BakedOpRendererTests.cpp",
311 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400312 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700313 "tests/unit/CanvasContextTests.cpp",
314 "tests/unit/CanvasStateTests.cpp",
315 "tests/unit/ClipAreaTests.cpp",
316 "tests/unit/DamageAccumulatorTests.cpp",
317 "tests/unit/DeferredLayerUpdaterTests.cpp",
318 "tests/unit/DeviceInfoTests.cpp",
319 "tests/unit/FatVectorTests.cpp",
320 "tests/unit/FontRendererTests.cpp",
321 "tests/unit/FrameBuilderTests.cpp",
322 "tests/unit/GlopBuilderTests.cpp",
323 "tests/unit/GpuMemoryTrackerTests.cpp",
324 "tests/unit/GradientCacheTests.cpp",
325 "tests/unit/GraphicsStatsServiceTests.cpp",
326 "tests/unit/LayerUpdateQueueTests.cpp",
327 "tests/unit/LeakCheckTests.cpp",
328 "tests/unit/LinearAllocatorTests.cpp",
329 "tests/unit/MatrixTests.cpp",
330 "tests/unit/MeshStateTests.cpp",
331 "tests/unit/OffscreenBufferPoolTests.cpp",
332 "tests/unit/OpDumperTests.cpp",
333 "tests/unit/PathInterpolatorTests.cpp",
334 "tests/unit/RenderNodeDrawableTests.cpp",
335 "tests/unit/RecordingCanvasTests.cpp",
336 "tests/unit/RenderNodeTests.cpp",
337 "tests/unit/RenderPropertiesTests.cpp",
338 "tests/unit/SkiaBehaviorTests.cpp",
339 "tests/unit/SkiaDisplayListTests.cpp",
340 "tests/unit/SkiaPipelineTests.cpp",
341 "tests/unit/SkiaRenderPropertiesTests.cpp",
342 "tests/unit/SkiaCanvasTests.cpp",
343 "tests/unit/SnapshotTests.cpp",
344 "tests/unit/StringUtilsTests.cpp",
345 "tests/unit/TestUtilsTests.cpp",
346 "tests/unit/TextDropShadowCacheTests.cpp",
347 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700348 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700349 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400350 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700351 ],
352}
353
354// ------------------------
355// Macro-bench app
356// ------------------------
357
358cc_benchmark {
359 name: "hwuimacro",
360 defaults: ["hwui_test_defaults"],
361
362 // set to libhwui_static_debug to skip actual GL commands
363 whole_static_libs: ["libhwui"],
364 shared_libs: ["libmemunreachable"],
365
366 srcs: [
367 "tests/macrobench/TestSceneRunner.cpp",
368 "tests/macrobench/main.cpp",
369 ],
370}
371
372// ------------------------
373// Micro-bench app
374// ---------------------
375
376cc_benchmark {
377 name: "hwuimicro",
378 defaults: ["hwui_test_defaults"],
379
380 cflags: [
381 "-include debug/wrap_gles.h",
382 "-DHWUI_NULL_GPU",
383 ],
384
385 whole_static_libs: ["libhwui_static_debug"],
386 shared_libs: ["libmemunreachable"],
387
388 srcs: [
389 "tests/microbench/main.cpp",
390 "tests/microbench/DisplayListCanvasBench.cpp",
391 "tests/microbench/FontBench.cpp",
392 "tests/microbench/FrameBuilderBench.cpp",
393 "tests/microbench/LinearAllocatorBench.cpp",
394 "tests/microbench/PathParserBench.cpp",
395 "tests/microbench/RenderNodeBench.cpp",
396 "tests/microbench/ShadowBench.cpp",
397 "tests/microbench/TaskManagerBench.cpp",
398 ],
399}