blob: 92d53da602b76b642497d09a17dde364f4ba84a1 [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",
Colin Crossf6298102017-04-19 15:25:25 -0700205 "ProfileRenderer.cpp",
206 "Program.cpp",
207 "ProgramCache.cpp",
208 "Properties.cpp",
209 "PropertyValuesAnimatorSet.cpp",
210 "PropertyValuesHolder.cpp",
211 "RecordingCanvas.cpp",
212 "RenderBufferCache.cpp",
213 "RenderNode.cpp",
214 "RenderProperties.cpp",
215 "ResourceCache.cpp",
216 "ShadowTessellator.cpp",
217 "SkiaCanvas.cpp",
218 "SkiaCanvasProxy.cpp",
219 "SkiaShader.cpp",
220 "Snapshot.cpp",
221 "SpotShadow.cpp",
222 "TessellationCache.cpp",
223 "TextDropShadowCache.cpp",
224 "Texture.cpp",
225 "TextureCache.cpp",
226 "VectorDrawable.cpp",
227 "VkLayer.cpp",
228 "protos/hwui.proto",
229 ],
230
231 proto: {
232 export_proto_headers: true,
233 },
234
235 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700236 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700237}
238
239cc_library {
240 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700241 defaults: [
242 "libhwui_defaults",
243
244 // Enables fine-grained GLES error checking
245 // If enabled, every GLES call is wrapped & error checked
246 // Has moderate overhead
247 "hwui_enable_opengl_validation",
248],
Colin Crossf6298102017-04-19 15:25:25 -0700249}
250
251// ------------------------
252// static library null gpu
253// ------------------------
254
255cc_library_static {
256 name: "libhwui_static_debug",
257 defaults: [
258 "libhwui_defaults",
259 "hwui_debug",
260 ],
261 cflags: ["-DHWUI_NULL_GPU"],
262 srcs: [
263 "debug/nullegl.cpp",
264 ],
Colin Crossf6298102017-04-19 15:25:25 -0700265}
266
267cc_defaults {
268 name: "hwui_test_defaults",
269 defaults: ["hwui_defaults"],
270 test_suites: ["device-tests"],
271 srcs: [
272 "tests/common/scenes/*.cpp",
273 "tests/common/LeakChecker.cpp",
274 "tests/common/TestListViewSceneBase.cpp",
275 "tests/common/TestContext.cpp",
276 "tests/common/TestScene.cpp",
277 "tests/common/TestUtils.cpp",
278 ],
279}
280
281// ------------------------
282// unit tests
283// ------------------------
284
285cc_test {
286 name: "hwui_unit_tests",
287 defaults: ["hwui_test_defaults"],
288
289 static_libs: [
290 "libgmock",
291 "libhwui_static_debug",
292 ],
293 shared_libs: ["libmemunreachable"],
294 cflags: [
295 "-include debug/wrap_gles.h",
296 "-DHWUI_NULL_GPU",
297 ],
298
299 srcs: [
300 "tests/unit/main.cpp",
301 "tests/unit/BakedOpDispatcherTests.cpp",
302 "tests/unit/BakedOpRendererTests.cpp",
303 "tests/unit/BakedOpStateTests.cpp",
304 "tests/unit/BitmapTests.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}