blob: ae4eabf94d073ff2ac4f4ce7cb1d737da032b0b3 [file] [log] [blame]
Colin Cross271c2e02017-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: ["."],
Colin Crossaf737302017-04-20 12:20:20 -0700240 export_shared_lib_headers: ["libRScpp"],
Colin Cross271c2e02017-04-19 15:25:25 -0700241}
242
243cc_library {
244 name: "libhwui",
245 defaults: ["libhwui_defaults"],
246}
247
248// ------------------------
249// static library null gpu
250// ------------------------
251
252cc_library_static {
253 name: "libhwui_static_debug",
254 defaults: [
255 "libhwui_defaults",
256 "hwui_debug",
257 ],
258 cflags: ["-DHWUI_NULL_GPU"],
259 srcs: [
260 "debug/nullegl.cpp",
261 ],
Colin Cross271c2e02017-04-19 15:25:25 -0700262}
263
264cc_defaults {
265 name: "hwui_test_defaults",
266 defaults: ["hwui_defaults"],
267 srcs: [
268 "tests/common/scenes/*.cpp",
269 "tests/common/LeakChecker.cpp",
270 "tests/common/TestListViewSceneBase.cpp",
271 "tests/common/TestContext.cpp",
272 "tests/common/TestScene.cpp",
273 "tests/common/TestUtils.cpp",
274 ],
275}
276
277// ------------------------
278// unit tests
279// ------------------------
280
281cc_test {
282 name: "hwui_unit_tests",
283 defaults: ["hwui_test_defaults"],
284
285 static_libs: [
286 "libgmock",
287 "libhwui_static_debug",
288 ],
289 shared_libs: ["libmemunreachable"],
290 cflags: [
291 "-include debug/wrap_gles.h",
292 "-DHWUI_NULL_GPU",
293 ],
294
295 srcs: [
296 "tests/unit/main.cpp",
297 "tests/unit/BakedOpDispatcherTests.cpp",
298 "tests/unit/BakedOpRendererTests.cpp",
299 "tests/unit/BakedOpStateTests.cpp",
300 "tests/unit/BitmapTests.cpp",
301 "tests/unit/CanvasContextTests.cpp",
302 "tests/unit/CanvasStateTests.cpp",
303 "tests/unit/ClipAreaTests.cpp",
304 "tests/unit/DamageAccumulatorTests.cpp",
305 "tests/unit/DeferredLayerUpdaterTests.cpp",
306 "tests/unit/DeviceInfoTests.cpp",
307 "tests/unit/FatVectorTests.cpp",
308 "tests/unit/FontRendererTests.cpp",
309 "tests/unit/FrameBuilderTests.cpp",
310 "tests/unit/GlopBuilderTests.cpp",
311 "tests/unit/GpuMemoryTrackerTests.cpp",
312 "tests/unit/GradientCacheTests.cpp",
313 "tests/unit/GraphicsStatsServiceTests.cpp",
314 "tests/unit/LayerUpdateQueueTests.cpp",
315 "tests/unit/LeakCheckTests.cpp",
316 "tests/unit/LinearAllocatorTests.cpp",
317 "tests/unit/MatrixTests.cpp",
318 "tests/unit/MeshStateTests.cpp",
319 "tests/unit/OffscreenBufferPoolTests.cpp",
320 "tests/unit/OpDumperTests.cpp",
321 "tests/unit/PathInterpolatorTests.cpp",
322 "tests/unit/RenderNodeDrawableTests.cpp",
323 "tests/unit/RecordingCanvasTests.cpp",
324 "tests/unit/RenderNodeTests.cpp",
325 "tests/unit/RenderPropertiesTests.cpp",
326 "tests/unit/SkiaBehaviorTests.cpp",
327 "tests/unit/SkiaDisplayListTests.cpp",
328 "tests/unit/SkiaPipelineTests.cpp",
329 "tests/unit/SkiaRenderPropertiesTests.cpp",
330 "tests/unit/SkiaCanvasTests.cpp",
331 "tests/unit/SnapshotTests.cpp",
332 "tests/unit/StringUtilsTests.cpp",
333 "tests/unit/TestUtilsTests.cpp",
334 "tests/unit/TextDropShadowCacheTests.cpp",
335 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka264d3be2017-05-01 22:17:36 -0700336 "tests/unit/TypefaceTests.cpp",
Colin Cross271c2e02017-04-19 15:25:25 -0700337 "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}