blob: c05fcc0cab688384d106287bbe5e5698bf00b7cc [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",
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",
Colin Crossf6298102017-04-19 15:25:25 -070057 "libui",
58 "libgui",
John Reck915883b2017-05-03 10:27:20 -070059 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070060 "libharfbuzz_ng",
61 "libft2",
62 "libminikin",
63 "libandroidfw",
64 "libRScpp",
65 ],
66 static_libs: [
67 "libplatformprotos",
68 ],
69}
70
71cc_defaults {
72 name: "hwui_bugreport_font_cache_usage",
73 srcs: ["font/FontCacheHistoryTracker.cpp"],
74 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
75}
76
77cc_defaults {
78 name: "hwui_compile_for_perf",
79 // TODO: Non-arm?
80 cflags: [
81 "-fno-omit-frame-pointer",
82 "-marm",
83 "-mapcs",
84 ],
85}
86
87cc_defaults {
88 name: "hwui_debug",
89 cflags: ["-include debug/wrap_gles.h"],
90 srcs: [
91 "debug/wrap_gles.cpp",
92 "debug/DefaultGlesDriver.cpp",
93 "debug/GlesErrorCheckWrapper.cpp",
94 "debug/GlesDriver.cpp",
95 "debug/FatalBaseDriver.cpp",
96 "debug/NullGlesDriver.cpp",
97 ],
98 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
99}
100
101cc_defaults {
102 name: "hwui_enable_opengl_validation",
103 defaults: ["hwui_debug"],
104 cflags: ["-DDEBUG_OPENGL=3"],
Colin Crossf6298102017-04-19 15:25:25 -0700105 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
106}
107
108// ------------------------
109// library
110// ------------------------
111
112cc_defaults {
113 name: "libhwui_defaults",
114 defaults: ["hwui_defaults"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400115
116 whole_static_libs: ["libskia"],
117
Colin Crossf6298102017-04-19 15:25:25 -0700118 srcs: [
119 "hwui/Bitmap.cpp",
120 "font/CacheTexture.cpp",
121 "font/Font.cpp",
122 "hwui/Canvas.cpp",
123 "hwui/MinikinSkia.cpp",
124 "hwui/MinikinUtils.cpp",
125 "hwui/PaintImpl.cpp",
126 "hwui/Typeface.cpp",
127 "pipeline/skia/GLFunctorDrawable.cpp",
128 "pipeline/skia/LayerDrawable.cpp",
129 "pipeline/skia/RenderNodeDrawable.cpp",
130 "pipeline/skia/ReorderBarrierDrawables.cpp",
131 "pipeline/skia/SkiaDisplayList.cpp",
132 "pipeline/skia/SkiaOpenGLPipeline.cpp",
133 "pipeline/skia/SkiaOpenGLReadback.cpp",
134 "pipeline/skia/SkiaPipeline.cpp",
135 "pipeline/skia/SkiaProfileRenderer.cpp",
136 "pipeline/skia/SkiaRecordingCanvas.cpp",
137 "pipeline/skia/SkiaVulkanPipeline.cpp",
138 "renderstate/Blend.cpp",
139 "renderstate/MeshState.cpp",
140 "renderstate/OffscreenBufferPool.cpp",
141 "renderstate/PixelBufferState.cpp",
142 "renderstate/RenderState.cpp",
143 "renderstate/Scissor.cpp",
144 "renderstate/Stencil.cpp",
145 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400146 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700147 "renderthread/CanvasContext.cpp",
148 "renderthread/OpenGLPipeline.cpp",
149 "renderthread/DrawFrameTask.cpp",
150 "renderthread/EglManager.cpp",
151 "renderthread/VulkanManager.cpp",
152 "renderthread/RenderProxy.cpp",
153 "renderthread/RenderTask.cpp",
154 "renderthread/RenderThread.cpp",
155 "renderthread/TimeLord.cpp",
156 "renderthread/Frame.cpp",
157 "service/GraphicsStatsService.cpp",
158 "thread/TaskManager.cpp",
159 "utils/Blur.cpp",
160 "utils/Color.cpp",
161 "utils/GLUtils.cpp",
162 "utils/LinearAllocator.cpp",
163 "utils/StringUtils.cpp",
164 "utils/TestWindowContext.cpp",
165 "utils/VectorDrawableUtils.cpp",
166 "AmbientShadow.cpp",
167 "AnimationContext.cpp",
168 "Animator.cpp",
169 "AnimatorManager.cpp",
170 "BakedOpDispatcher.cpp",
171 "BakedOpRenderer.cpp",
172 "BakedOpState.cpp",
173 "Caches.cpp",
174 "CanvasState.cpp",
175 "ClipArea.cpp",
176 "DamageAccumulator.cpp",
177 "DeferredLayerUpdater.cpp",
178 "DeviceInfo.cpp",
179 "DisplayList.cpp",
180 "Extensions.cpp",
181 "FboCache.cpp",
182 "FontRenderer.cpp",
183 "FrameBuilder.cpp",
184 "FrameInfo.cpp",
185 "FrameInfoVisualizer.cpp",
186 "GammaFontRenderer.cpp",
187 "GlLayer.cpp",
188 "GlopBuilder.cpp",
189 "GpuMemoryTracker.cpp",
190 "GradientCache.cpp",
191 "Image.cpp",
192 "Interpolator.cpp",
193 "JankTracker.cpp",
194 "Layer.cpp",
195 "LayerBuilder.cpp",
196 "LayerUpdateQueue.cpp",
197 "Matrix.cpp",
198 "OpDumper.cpp",
199 "OpenGLReadback.cpp",
200 "Patch.cpp",
201 "PatchCache.cpp",
202 "PathCache.cpp",
203 "PathParser.cpp",
204 "PathTessellator.cpp",
205 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700206 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700207 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700208 "ProfileRenderer.cpp",
209 "Program.cpp",
210 "ProgramCache.cpp",
211 "Properties.cpp",
212 "PropertyValuesAnimatorSet.cpp",
213 "PropertyValuesHolder.cpp",
214 "RecordingCanvas.cpp",
215 "RenderBufferCache.cpp",
216 "RenderNode.cpp",
217 "RenderProperties.cpp",
218 "ResourceCache.cpp",
219 "ShadowTessellator.cpp",
220 "SkiaCanvas.cpp",
221 "SkiaCanvasProxy.cpp",
222 "SkiaShader.cpp",
223 "Snapshot.cpp",
224 "SpotShadow.cpp",
225 "TessellationCache.cpp",
226 "TextDropShadowCache.cpp",
227 "Texture.cpp",
228 "TextureCache.cpp",
229 "VectorDrawable.cpp",
230 "VkLayer.cpp",
231 "protos/hwui.proto",
232 ],
233
234 proto: {
235 export_proto_headers: true,
236 },
237
238 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700239 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700240}
241
242cc_library {
243 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700244 defaults: [
245 "libhwui_defaults",
246
247 // Enables fine-grained GLES error checking
248 // If enabled, every GLES call is wrapped & error checked
249 // Has moderate overhead
250 "hwui_enable_opengl_validation",
251],
Colin Crossf6298102017-04-19 15:25:25 -0700252}
253
254// ------------------------
255// static library null gpu
256// ------------------------
257
258cc_library_static {
259 name: "libhwui_static_debug",
260 defaults: [
261 "libhwui_defaults",
262 "hwui_debug",
263 ],
264 cflags: ["-DHWUI_NULL_GPU"],
265 srcs: [
266 "debug/nullegl.cpp",
267 ],
Colin Crossf6298102017-04-19 15:25:25 -0700268}
269
270cc_defaults {
271 name: "hwui_test_defaults",
272 defaults: ["hwui_defaults"],
273 test_suites: ["device-tests"],
274 srcs: [
275 "tests/common/scenes/*.cpp",
276 "tests/common/LeakChecker.cpp",
277 "tests/common/TestListViewSceneBase.cpp",
278 "tests/common/TestContext.cpp",
279 "tests/common/TestScene.cpp",
280 "tests/common/TestUtils.cpp",
281 ],
282}
283
284// ------------------------
285// unit tests
286// ------------------------
287
288cc_test {
289 name: "hwui_unit_tests",
290 defaults: ["hwui_test_defaults"],
291
292 static_libs: [
293 "libgmock",
294 "libhwui_static_debug",
295 ],
296 shared_libs: ["libmemunreachable"],
297 cflags: [
298 "-include debug/wrap_gles.h",
299 "-DHWUI_NULL_GPU",
300 ],
301
302 srcs: [
303 "tests/unit/main.cpp",
304 "tests/unit/BakedOpDispatcherTests.cpp",
305 "tests/unit/BakedOpRendererTests.cpp",
306 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400307 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700308 "tests/unit/CanvasContextTests.cpp",
309 "tests/unit/CanvasStateTests.cpp",
310 "tests/unit/ClipAreaTests.cpp",
311 "tests/unit/DamageAccumulatorTests.cpp",
312 "tests/unit/DeferredLayerUpdaterTests.cpp",
313 "tests/unit/DeviceInfoTests.cpp",
314 "tests/unit/FatVectorTests.cpp",
315 "tests/unit/FontRendererTests.cpp",
316 "tests/unit/FrameBuilderTests.cpp",
317 "tests/unit/GlopBuilderTests.cpp",
318 "tests/unit/GpuMemoryTrackerTests.cpp",
319 "tests/unit/GradientCacheTests.cpp",
320 "tests/unit/GraphicsStatsServiceTests.cpp",
321 "tests/unit/LayerUpdateQueueTests.cpp",
322 "tests/unit/LeakCheckTests.cpp",
323 "tests/unit/LinearAllocatorTests.cpp",
324 "tests/unit/MatrixTests.cpp",
325 "tests/unit/MeshStateTests.cpp",
326 "tests/unit/OffscreenBufferPoolTests.cpp",
327 "tests/unit/OpDumperTests.cpp",
328 "tests/unit/PathInterpolatorTests.cpp",
329 "tests/unit/RenderNodeDrawableTests.cpp",
330 "tests/unit/RecordingCanvasTests.cpp",
331 "tests/unit/RenderNodeTests.cpp",
332 "tests/unit/RenderPropertiesTests.cpp",
333 "tests/unit/SkiaBehaviorTests.cpp",
334 "tests/unit/SkiaDisplayListTests.cpp",
335 "tests/unit/SkiaPipelineTests.cpp",
336 "tests/unit/SkiaRenderPropertiesTests.cpp",
337 "tests/unit/SkiaCanvasTests.cpp",
338 "tests/unit/SnapshotTests.cpp",
339 "tests/unit/StringUtilsTests.cpp",
340 "tests/unit/TestUtilsTests.cpp",
341 "tests/unit/TextDropShadowCacheTests.cpp",
342 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700343 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700344 "tests/unit/VectorDrawableTests.cpp",
345 ],
346}
347
348// ------------------------
349// Macro-bench app
350// ------------------------
351
352cc_benchmark {
353 name: "hwuimacro",
354 defaults: ["hwui_test_defaults"],
355
356 // set to libhwui_static_debug to skip actual GL commands
357 whole_static_libs: ["libhwui"],
358 shared_libs: ["libmemunreachable"],
359
360 srcs: [
361 "tests/macrobench/TestSceneRunner.cpp",
362 "tests/macrobench/main.cpp",
363 ],
364}
365
366// ------------------------
367// Micro-bench app
368// ---------------------
369
370cc_benchmark {
371 name: "hwuimicro",
372 defaults: ["hwui_test_defaults"],
373
374 cflags: [
375 "-include debug/wrap_gles.h",
376 "-DHWUI_NULL_GPU",
377 ],
378
379 whole_static_libs: ["libhwui_static_debug"],
380 shared_libs: ["libmemunreachable"],
381
382 srcs: [
383 "tests/microbench/main.cpp",
384 "tests/microbench/DisplayListCanvasBench.cpp",
385 "tests/microbench/FontBench.cpp",
386 "tests/microbench/FrameBuilderBench.cpp",
387 "tests/microbench/LinearAllocatorBench.cpp",
388 "tests/microbench/PathParserBench.cpp",
389 "tests/microbench/RenderNodeBench.cpp",
390 "tests/microbench/ShadowBench.cpp",
391 "tests/microbench/TaskManagerBench.cpp",
392 ],
393}