blob: 9f2d1291a9d6240a17e104f6e1b6377def025a6b [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",
8
9 // Enables fine-grained GLES error checking
10 // If enabled, every GLES call is wrapped & error checked
11 // Has moderate overhead
12 //"hwui_enable_opengl-validation",
13 ],
14
15 cflags: [
16 "-DEGL_EGLEXT_PROTOTYPES",
17 "-DGL_GLEXT_PROTOTYPES",
18 "-DATRACE_TAG=ATRACE_TAG_VIEW",
19 "-DLOG_TAG=\"OpenGLRenderer\"",
20 "-Wall",
21 "-Wno-unused-parameter",
22 "-Wunreachable-code",
23 "-Werror",
24 "-fvisibility=hidden",
25
26 // GCC false-positives on this warning, and since we -Werror that's
27 // a problem
28 "-Wno-free-nonheap-object",
29
30 // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629
31 "-Wno-missing-braces",
32
33 // TODO: Linear blending should be enabled by default, but we are
34 // TODO: making it an opt-in while it's a work in progress
35 //"-DANDROID_ENABLE_LINEAR_BLENDING",
36 ],
37
38 include_dirs: [
39 "external/skia/include/private",
40 "external/skia/src/core",
41 "external/skia/src/effects",
42 "external/skia/src/image",
43 "external/skia/src/utils",
44 ],
45
46 product_variables: {
47 device_uses_hwc2: {
48 cflags: ["-DUSE_HWC2"],
49 },
50 },
51}
52
53cc_defaults {
54 name: "hwui_static_deps",
55 shared_libs: [
56 "liblog",
57 "libcutils",
58 "libutils",
59 "libEGL",
60 "libGLESv2",
61 "libvulkan",
62 "libskia",
63 "libui",
64 "libgui",
65 "libprotobuf-cpp-full",
66 "libharfbuzz_ng",
67 "libft2",
68 "libminikin",
69 "libandroidfw",
70 "libRScpp",
71 ],
72 static_libs: [
73 "libplatformprotos",
74 ],
75}
76
77cc_defaults {
78 name: "hwui_bugreport_font_cache_usage",
79 srcs: ["font/FontCacheHistoryTracker.cpp"],
80 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"],
81}
82
83cc_defaults {
84 name: "hwui_compile_for_perf",
85 // TODO: Non-arm?
86 cflags: [
87 "-fno-omit-frame-pointer",
88 "-marm",
89 "-mapcs",
90 ],
91}
92
93cc_defaults {
94 name: "hwui_debug",
95 cflags: ["-include debug/wrap_gles.h"],
96 srcs: [
97 "debug/wrap_gles.cpp",
98 "debug/DefaultGlesDriver.cpp",
99 "debug/GlesErrorCheckWrapper.cpp",
100 "debug/GlesDriver.cpp",
101 "debug/FatalBaseDriver.cpp",
102 "debug/NullGlesDriver.cpp",
103 ],
104 include_dirs: ["frameworks/native/opengl/libs/GLES2"],
105}
106
107cc_defaults {
108 name: "hwui_enable_opengl_validation",
109 defaults: ["hwui_debug"],
110 cflags: ["-DDEBUG_OPENGL=3"],
111 srcs: ["debug/wrap_gles.cpp"],
112 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",
142 "renderstate/Blend.cpp",
143 "renderstate/MeshState.cpp",
144 "renderstate/OffscreenBufferPool.cpp",
145 "renderstate/PixelBufferState.cpp",
146 "renderstate/RenderState.cpp",
147 "renderstate/Scissor.cpp",
148 "renderstate/Stencil.cpp",
149 "renderstate/TextureState.cpp",
150 "renderthread/CanvasContext.cpp",
151 "renderthread/OpenGLPipeline.cpp",
152 "renderthread/DrawFrameTask.cpp",
153 "renderthread/EglManager.cpp",
154 "renderthread/VulkanManager.cpp",
155 "renderthread/RenderProxy.cpp",
156 "renderthread/RenderTask.cpp",
157 "renderthread/RenderThread.cpp",
158 "renderthread/TimeLord.cpp",
159 "renderthread/Frame.cpp",
160 "service/GraphicsStatsService.cpp",
161 "thread/TaskManager.cpp",
162 "utils/Blur.cpp",
163 "utils/Color.cpp",
164 "utils/GLUtils.cpp",
165 "utils/LinearAllocator.cpp",
166 "utils/StringUtils.cpp",
167 "utils/TestWindowContext.cpp",
168 "utils/VectorDrawableUtils.cpp",
169 "AmbientShadow.cpp",
170 "AnimationContext.cpp",
171 "Animator.cpp",
172 "AnimatorManager.cpp",
173 "BakedOpDispatcher.cpp",
174 "BakedOpRenderer.cpp",
175 "BakedOpState.cpp",
176 "Caches.cpp",
177 "CanvasState.cpp",
178 "ClipArea.cpp",
179 "DamageAccumulator.cpp",
180 "DeferredLayerUpdater.cpp",
181 "DeviceInfo.cpp",
182 "DisplayList.cpp",
183 "Extensions.cpp",
184 "FboCache.cpp",
185 "FontRenderer.cpp",
186 "FrameBuilder.cpp",
187 "FrameInfo.cpp",
188 "FrameInfoVisualizer.cpp",
189 "GammaFontRenderer.cpp",
190 "GlLayer.cpp",
191 "GlopBuilder.cpp",
192 "GpuMemoryTracker.cpp",
193 "GradientCache.cpp",
194 "Image.cpp",
195 "Interpolator.cpp",
196 "JankTracker.cpp",
197 "Layer.cpp",
198 "LayerBuilder.cpp",
199 "LayerUpdateQueue.cpp",
200 "Matrix.cpp",
201 "OpDumper.cpp",
202 "OpenGLReadback.cpp",
203 "Patch.cpp",
204 "PatchCache.cpp",
205 "PathCache.cpp",
206 "PathParser.cpp",
207 "PathTessellator.cpp",
208 "PixelBuffer.cpp",
209 "ProfileRenderer.cpp",
210 "Program.cpp",
211 "ProgramCache.cpp",
212 "Properties.cpp",
213 "PropertyValuesAnimatorSet.cpp",
214 "PropertyValuesHolder.cpp",
215 "RecordingCanvas.cpp",
216 "RenderBufferCache.cpp",
217 "RenderNode.cpp",
218 "RenderProperties.cpp",
219 "ResourceCache.cpp",
220 "ShadowTessellator.cpp",
221 "SkiaCanvas.cpp",
222 "SkiaCanvasProxy.cpp",
223 "SkiaShader.cpp",
224 "Snapshot.cpp",
225 "SpotShadow.cpp",
226 "TessellationCache.cpp",
227 "TextDropShadowCache.cpp",
228 "Texture.cpp",
229 "TextureCache.cpp",
230 "VectorDrawable.cpp",
231 "VkLayer.cpp",
232 "protos/hwui.proto",
233 ],
234
235 proto: {
236 export_proto_headers: true,
237 },
238
239 export_include_dirs: ["."],
240}
241
242cc_library {
243 name: "libhwui",
244 defaults: ["libhwui_defaults"],
245}
246
247// ------------------------
248// static library null gpu
249// ------------------------
250
251cc_library_static {
252 name: "libhwui_static_debug",
253 defaults: [
254 "libhwui_defaults",
255 "hwui_debug",
256 ],
257 cflags: ["-DHWUI_NULL_GPU"],
258 srcs: [
259 "debug/nullegl.cpp",
260 ],
261 export_include_dirs: ["."],
262}
263
264cc_defaults {
265 name: "hwui_test_defaults",
266 defaults: ["hwui_defaults"],
267 test_suites: ["device-tests"],
268 srcs: [
269 "tests/common/scenes/*.cpp",
270 "tests/common/LeakChecker.cpp",
271 "tests/common/TestListViewSceneBase.cpp",
272 "tests/common/TestContext.cpp",
273 "tests/common/TestScene.cpp",
274 "tests/common/TestUtils.cpp",
275 ],
276}
277
278// ------------------------
279// unit tests
280// ------------------------
281
282cc_test {
283 name: "hwui_unit_tests",
284 defaults: ["hwui_test_defaults"],
285
286 static_libs: [
287 "libgmock",
288 "libhwui_static_debug",
289 ],
290 shared_libs: ["libmemunreachable"],
291 cflags: [
292 "-include debug/wrap_gles.h",
293 "-DHWUI_NULL_GPU",
294 ],
295
296 srcs: [
297 "tests/unit/main.cpp",
298 "tests/unit/BakedOpDispatcherTests.cpp",
299 "tests/unit/BakedOpRendererTests.cpp",
300 "tests/unit/BakedOpStateTests.cpp",
301 "tests/unit/BitmapTests.cpp",
302 "tests/unit/CanvasContextTests.cpp",
303 "tests/unit/CanvasStateTests.cpp",
304 "tests/unit/ClipAreaTests.cpp",
305 "tests/unit/DamageAccumulatorTests.cpp",
306 "tests/unit/DeferredLayerUpdaterTests.cpp",
307 "tests/unit/DeviceInfoTests.cpp",
308 "tests/unit/FatVectorTests.cpp",
309 "tests/unit/FontRendererTests.cpp",
310 "tests/unit/FrameBuilderTests.cpp",
311 "tests/unit/GlopBuilderTests.cpp",
312 "tests/unit/GpuMemoryTrackerTests.cpp",
313 "tests/unit/GradientCacheTests.cpp",
314 "tests/unit/GraphicsStatsServiceTests.cpp",
315 "tests/unit/LayerUpdateQueueTests.cpp",
316 "tests/unit/LeakCheckTests.cpp",
317 "tests/unit/LinearAllocatorTests.cpp",
318 "tests/unit/MatrixTests.cpp",
319 "tests/unit/MeshStateTests.cpp",
320 "tests/unit/OffscreenBufferPoolTests.cpp",
321 "tests/unit/OpDumperTests.cpp",
322 "tests/unit/PathInterpolatorTests.cpp",
323 "tests/unit/RenderNodeDrawableTests.cpp",
324 "tests/unit/RecordingCanvasTests.cpp",
325 "tests/unit/RenderNodeTests.cpp",
326 "tests/unit/RenderPropertiesTests.cpp",
327 "tests/unit/SkiaBehaviorTests.cpp",
328 "tests/unit/SkiaDisplayListTests.cpp",
329 "tests/unit/SkiaPipelineTests.cpp",
330 "tests/unit/SkiaRenderPropertiesTests.cpp",
331 "tests/unit/SkiaCanvasTests.cpp",
332 "tests/unit/SnapshotTests.cpp",
333 "tests/unit/StringUtilsTests.cpp",
334 "tests/unit/TestUtilsTests.cpp",
335 "tests/unit/TextDropShadowCacheTests.cpp",
336 "tests/unit/TextureCacheTests.cpp",
337 "tests/unit/VectorDrawableTests.cpp",
338 ],
339}
340
341// ------------------------
342// Macro-bench app
343// ------------------------
344
345cc_benchmark {
346 name: "hwuimacro",
347 defaults: ["hwui_test_defaults"],
348
349 // set to libhwui_static_debug to skip actual GL commands
350 whole_static_libs: ["libhwui"],
351 shared_libs: ["libmemunreachable"],
352
353 srcs: [
354 "tests/macrobench/TestSceneRunner.cpp",
355 "tests/macrobench/main.cpp",
356 ],
357}
358
359// ------------------------
360// Micro-bench app
361// ---------------------
362
363cc_benchmark {
364 name: "hwuimicro",
365 defaults: ["hwui_test_defaults"],
366
367 cflags: [
368 "-include debug/wrap_gles.h",
369 "-DHWUI_NULL_GPU",
370 ],
371
372 whole_static_libs: ["libhwui_static_debug"],
373 shared_libs: ["libmemunreachable"],
374
375 srcs: [
376 "tests/microbench/main.cpp",
377 "tests/microbench/DisplayListCanvasBench.cpp",
378 "tests/microbench/FontBench.cpp",
379 "tests/microbench/FrameBuilderBench.cpp",
380 "tests/microbench/LinearAllocatorBench.cpp",
381 "tests/microbench/PathParserBench.cpp",
382 "tests/microbench/RenderNodeBench.cpp",
383 "tests/microbench/ShadowBench.cpp",
384 "tests/microbench/TaskManagerBench.cpp",
385 ],
386}