blob: 842e053f054b25f0d9a4bb2c08f5a9845f300700 [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",
39 ],
40
41 product_variables: {
42 device_uses_hwc2: {
43 cflags: ["-DUSE_HWC2"],
44 },
45 },
46}
47
48cc_defaults {
49 name: "hwui_static_deps",
50 shared_libs: [
51 "liblog",
52 "libcutils",
53 "libutils",
54 "libEGL",
55 "libGLESv2",
56 "libvulkan",
57 "libskia",
58 "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"],
116 srcs: [
117 "hwui/Bitmap.cpp",
118 "font/CacheTexture.cpp",
119 "font/Font.cpp",
120 "hwui/Canvas.cpp",
121 "hwui/MinikinSkia.cpp",
122 "hwui/MinikinUtils.cpp",
123 "hwui/PaintImpl.cpp",
124 "hwui/Typeface.cpp",
125 "pipeline/skia/GLFunctorDrawable.cpp",
126 "pipeline/skia/LayerDrawable.cpp",
127 "pipeline/skia/RenderNodeDrawable.cpp",
128 "pipeline/skia/ReorderBarrierDrawables.cpp",
129 "pipeline/skia/SkiaDisplayList.cpp",
130 "pipeline/skia/SkiaOpenGLPipeline.cpp",
131 "pipeline/skia/SkiaOpenGLReadback.cpp",
132 "pipeline/skia/SkiaPipeline.cpp",
133 "pipeline/skia/SkiaProfileRenderer.cpp",
134 "pipeline/skia/SkiaRecordingCanvas.cpp",
135 "pipeline/skia/SkiaVulkanPipeline.cpp",
136 "renderstate/Blend.cpp",
137 "renderstate/MeshState.cpp",
138 "renderstate/OffscreenBufferPool.cpp",
139 "renderstate/PixelBufferState.cpp",
140 "renderstate/RenderState.cpp",
141 "renderstate/Scissor.cpp",
142 "renderstate/Stencil.cpp",
143 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400144 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700145 "renderthread/CanvasContext.cpp",
146 "renderthread/OpenGLPipeline.cpp",
147 "renderthread/DrawFrameTask.cpp",
148 "renderthread/EglManager.cpp",
149 "renderthread/VulkanManager.cpp",
150 "renderthread/RenderProxy.cpp",
151 "renderthread/RenderTask.cpp",
152 "renderthread/RenderThread.cpp",
153 "renderthread/TimeLord.cpp",
154 "renderthread/Frame.cpp",
155 "service/GraphicsStatsService.cpp",
156 "thread/TaskManager.cpp",
157 "utils/Blur.cpp",
158 "utils/Color.cpp",
159 "utils/GLUtils.cpp",
160 "utils/LinearAllocator.cpp",
161 "utils/StringUtils.cpp",
162 "utils/TestWindowContext.cpp",
163 "utils/VectorDrawableUtils.cpp",
164 "AmbientShadow.cpp",
165 "AnimationContext.cpp",
166 "Animator.cpp",
167 "AnimatorManager.cpp",
168 "BakedOpDispatcher.cpp",
169 "BakedOpRenderer.cpp",
170 "BakedOpState.cpp",
171 "Caches.cpp",
172 "CanvasState.cpp",
173 "ClipArea.cpp",
174 "DamageAccumulator.cpp",
175 "DeferredLayerUpdater.cpp",
176 "DeviceInfo.cpp",
177 "DisplayList.cpp",
178 "Extensions.cpp",
179 "FboCache.cpp",
180 "FontRenderer.cpp",
181 "FrameBuilder.cpp",
182 "FrameInfo.cpp",
183 "FrameInfoVisualizer.cpp",
184 "GammaFontRenderer.cpp",
185 "GlLayer.cpp",
186 "GlopBuilder.cpp",
187 "GpuMemoryTracker.cpp",
188 "GradientCache.cpp",
189 "Image.cpp",
190 "Interpolator.cpp",
191 "JankTracker.cpp",
192 "Layer.cpp",
193 "LayerBuilder.cpp",
194 "LayerUpdateQueue.cpp",
195 "Matrix.cpp",
196 "OpDumper.cpp",
197 "OpenGLReadback.cpp",
198 "Patch.cpp",
199 "PatchCache.cpp",
200 "PathCache.cpp",
201 "PathParser.cpp",
202 "PathTessellator.cpp",
203 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700204 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700205 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700206 "ProfileRenderer.cpp",
207 "Program.cpp",
208 "ProgramCache.cpp",
209 "Properties.cpp",
210 "PropertyValuesAnimatorSet.cpp",
211 "PropertyValuesHolder.cpp",
212 "RecordingCanvas.cpp",
213 "RenderBufferCache.cpp",
214 "RenderNode.cpp",
215 "RenderProperties.cpp",
216 "ResourceCache.cpp",
217 "ShadowTessellator.cpp",
218 "SkiaCanvas.cpp",
219 "SkiaCanvasProxy.cpp",
220 "SkiaShader.cpp",
221 "Snapshot.cpp",
222 "SpotShadow.cpp",
223 "TessellationCache.cpp",
224 "TextDropShadowCache.cpp",
225 "Texture.cpp",
226 "TextureCache.cpp",
227 "VectorDrawable.cpp",
228 "VkLayer.cpp",
229 "protos/hwui.proto",
230 ],
231
232 proto: {
233 export_proto_headers: true,
234 },
235
236 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700237 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700238}
239
240cc_library {
241 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700242 defaults: [
243 "libhwui_defaults",
244
245 // Enables fine-grained GLES error checking
246 // If enabled, every GLES call is wrapped & error checked
247 // Has moderate overhead
248 "hwui_enable_opengl_validation",
249],
Colin Crossf6298102017-04-19 15:25:25 -0700250}
251
252// ------------------------
253// static library null gpu
254// ------------------------
255
256cc_library_static {
257 name: "libhwui_static_debug",
258 defaults: [
259 "libhwui_defaults",
260 "hwui_debug",
261 ],
262 cflags: ["-DHWUI_NULL_GPU"],
263 srcs: [
264 "debug/nullegl.cpp",
265 ],
Colin Crossf6298102017-04-19 15:25:25 -0700266}
267
268cc_defaults {
269 name: "hwui_test_defaults",
270 defaults: ["hwui_defaults"],
271 test_suites: ["device-tests"],
272 srcs: [
273 "tests/common/scenes/*.cpp",
274 "tests/common/LeakChecker.cpp",
275 "tests/common/TestListViewSceneBase.cpp",
276 "tests/common/TestContext.cpp",
277 "tests/common/TestScene.cpp",
278 "tests/common/TestUtils.cpp",
279 ],
280}
281
282// ------------------------
283// unit tests
284// ------------------------
285
286cc_test {
287 name: "hwui_unit_tests",
288 defaults: ["hwui_test_defaults"],
289
290 static_libs: [
291 "libgmock",
292 "libhwui_static_debug",
293 ],
294 shared_libs: ["libmemunreachable"],
295 cflags: [
296 "-include debug/wrap_gles.h",
297 "-DHWUI_NULL_GPU",
298 ],
299
300 srcs: [
301 "tests/unit/main.cpp",
302 "tests/unit/BakedOpDispatcherTests.cpp",
303 "tests/unit/BakedOpRendererTests.cpp",
304 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400305 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700306 "tests/unit/CanvasContextTests.cpp",
307 "tests/unit/CanvasStateTests.cpp",
308 "tests/unit/ClipAreaTests.cpp",
309 "tests/unit/DamageAccumulatorTests.cpp",
310 "tests/unit/DeferredLayerUpdaterTests.cpp",
311 "tests/unit/DeviceInfoTests.cpp",
312 "tests/unit/FatVectorTests.cpp",
313 "tests/unit/FontRendererTests.cpp",
314 "tests/unit/FrameBuilderTests.cpp",
315 "tests/unit/GlopBuilderTests.cpp",
316 "tests/unit/GpuMemoryTrackerTests.cpp",
317 "tests/unit/GradientCacheTests.cpp",
318 "tests/unit/GraphicsStatsServiceTests.cpp",
319 "tests/unit/LayerUpdateQueueTests.cpp",
320 "tests/unit/LeakCheckTests.cpp",
321 "tests/unit/LinearAllocatorTests.cpp",
322 "tests/unit/MatrixTests.cpp",
323 "tests/unit/MeshStateTests.cpp",
324 "tests/unit/OffscreenBufferPoolTests.cpp",
325 "tests/unit/OpDumperTests.cpp",
326 "tests/unit/PathInterpolatorTests.cpp",
327 "tests/unit/RenderNodeDrawableTests.cpp",
328 "tests/unit/RecordingCanvasTests.cpp",
329 "tests/unit/RenderNodeTests.cpp",
330 "tests/unit/RenderPropertiesTests.cpp",
331 "tests/unit/SkiaBehaviorTests.cpp",
332 "tests/unit/SkiaDisplayListTests.cpp",
333 "tests/unit/SkiaPipelineTests.cpp",
334 "tests/unit/SkiaRenderPropertiesTests.cpp",
335 "tests/unit/SkiaCanvasTests.cpp",
336 "tests/unit/SnapshotTests.cpp",
337 "tests/unit/StringUtilsTests.cpp",
338 "tests/unit/TestUtilsTests.cpp",
339 "tests/unit/TextDropShadowCacheTests.cpp",
340 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700341 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700342 "tests/unit/VectorDrawableTests.cpp",
343 ],
344}
345
346// ------------------------
347// Macro-bench app
348// ------------------------
349
350cc_benchmark {
351 name: "hwuimacro",
352 defaults: ["hwui_test_defaults"],
353
354 // set to libhwui_static_debug to skip actual GL commands
355 whole_static_libs: ["libhwui"],
356 shared_libs: ["libmemunreachable"],
357
358 srcs: [
359 "tests/macrobench/TestSceneRunner.cpp",
360 "tests/macrobench/main.cpp",
361 ],
362}
363
364// ------------------------
365// Micro-bench app
366// ---------------------
367
368cc_benchmark {
369 name: "hwuimicro",
370 defaults: ["hwui_test_defaults"],
371
372 cflags: [
373 "-include debug/wrap_gles.h",
374 "-DHWUI_NULL_GPU",
375 ],
376
377 whole_static_libs: ["libhwui_static_debug"],
378 shared_libs: ["libmemunreachable"],
379
380 srcs: [
381 "tests/microbench/main.cpp",
382 "tests/microbench/DisplayListCanvasBench.cpp",
383 "tests/microbench/FontBench.cpp",
384 "tests/microbench/FrameBuilderBench.cpp",
385 "tests/microbench/LinearAllocatorBench.cpp",
386 "tests/microbench/PathParserBench.cpp",
387 "tests/microbench/RenderNodeBench.cpp",
388 "tests/microbench/ShadowBench.cpp",
389 "tests/microbench/TaskManagerBench.cpp",
390 ],
391}