blob: 07ff27de794f00c2603a52edaf5fbb4853ae141d [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
Narayan Kamathd6b42a92017-06-01 08:54:50 +000012 //"hwui_enable_opengl-validation",
Colin Crossf6298102017-04-19 15:25:25 -070013 ],
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",
John Reck915883b2017-05-03 10:27:20 -070065 "libprotobuf-cpp-lite",
Colin Crossf6298102017-04-19 15:25:25 -070066 "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 Cross3f8fd402017-04-20 12:20:20 -0700240 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-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 Crossf6298102017-04-19 15:25:25 -0700262}
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",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700337 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700338 "tests/unit/VectorDrawableTests.cpp",
339 ],
340}
341
342// ------------------------
343// Macro-bench app
344// ------------------------
345
346cc_benchmark {
347 name: "hwuimacro",
348 defaults: ["hwui_test_defaults"],
349
350 // set to libhwui_static_debug to skip actual GL commands
351 whole_static_libs: ["libhwui"],
352 shared_libs: ["libmemunreachable"],
353
354 srcs: [
355 "tests/macrobench/TestSceneRunner.cpp",
356 "tests/macrobench/main.cpp",
357 ],
358}
359
360// ------------------------
361// Micro-bench app
362// ---------------------
363
364cc_benchmark {
365 name: "hwuimicro",
366 defaults: ["hwui_test_defaults"],
367
368 cflags: [
369 "-include debug/wrap_gles.h",
370 "-DHWUI_NULL_GPU",
371 ],
372
373 whole_static_libs: ["libhwui_static_debug"],
374 shared_libs: ["libmemunreachable"],
375
376 srcs: [
377 "tests/microbench/main.cpp",
378 "tests/microbench/DisplayListCanvasBench.cpp",
379 "tests/microbench/FontBench.cpp",
380 "tests/microbench/FrameBuilderBench.cpp",
381 "tests/microbench/LinearAllocatorBench.cpp",
382 "tests/microbench/PathParserBench.cpp",
383 "tests/microbench/RenderNodeBench.cpp",
384 "tests/microbench/ShadowBench.cpp",
385 "tests/microbench/TaskManagerBench.cpp",
386 ],
387}