blob: 4cfb9d88c7168fbe2df9f492fbf2785f03e53262 [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",
144 "renderthread/CanvasContext.cpp",
145 "renderthread/OpenGLPipeline.cpp",
146 "renderthread/DrawFrameTask.cpp",
147 "renderthread/EglManager.cpp",
148 "renderthread/VulkanManager.cpp",
149 "renderthread/RenderProxy.cpp",
150 "renderthread/RenderTask.cpp",
151 "renderthread/RenderThread.cpp",
152 "renderthread/TimeLord.cpp",
153 "renderthread/Frame.cpp",
154 "service/GraphicsStatsService.cpp",
155 "thread/TaskManager.cpp",
156 "utils/Blur.cpp",
157 "utils/Color.cpp",
158 "utils/GLUtils.cpp",
159 "utils/LinearAllocator.cpp",
160 "utils/StringUtils.cpp",
161 "utils/TestWindowContext.cpp",
162 "utils/VectorDrawableUtils.cpp",
163 "AmbientShadow.cpp",
164 "AnimationContext.cpp",
165 "Animator.cpp",
166 "AnimatorManager.cpp",
167 "BakedOpDispatcher.cpp",
168 "BakedOpRenderer.cpp",
169 "BakedOpState.cpp",
170 "Caches.cpp",
171 "CanvasState.cpp",
172 "ClipArea.cpp",
173 "DamageAccumulator.cpp",
174 "DeferredLayerUpdater.cpp",
175 "DeviceInfo.cpp",
176 "DisplayList.cpp",
177 "Extensions.cpp",
178 "FboCache.cpp",
179 "FontRenderer.cpp",
180 "FrameBuilder.cpp",
181 "FrameInfo.cpp",
182 "FrameInfoVisualizer.cpp",
183 "GammaFontRenderer.cpp",
184 "GlLayer.cpp",
185 "GlopBuilder.cpp",
186 "GpuMemoryTracker.cpp",
187 "GradientCache.cpp",
188 "Image.cpp",
189 "Interpolator.cpp",
190 "JankTracker.cpp",
191 "Layer.cpp",
192 "LayerBuilder.cpp",
193 "LayerUpdateQueue.cpp",
194 "Matrix.cpp",
195 "OpDumper.cpp",
196 "OpenGLReadback.cpp",
197 "Patch.cpp",
198 "PatchCache.cpp",
199 "PathCache.cpp",
200 "PathParser.cpp",
201 "PathTessellator.cpp",
202 "PixelBuffer.cpp",
203 "ProfileRenderer.cpp",
204 "Program.cpp",
205 "ProgramCache.cpp",
206 "Properties.cpp",
207 "PropertyValuesAnimatorSet.cpp",
208 "PropertyValuesHolder.cpp",
209 "RecordingCanvas.cpp",
210 "RenderBufferCache.cpp",
211 "RenderNode.cpp",
212 "RenderProperties.cpp",
213 "ResourceCache.cpp",
214 "ShadowTessellator.cpp",
215 "SkiaCanvas.cpp",
216 "SkiaCanvasProxy.cpp",
217 "SkiaShader.cpp",
218 "Snapshot.cpp",
219 "SpotShadow.cpp",
220 "TessellationCache.cpp",
221 "TextDropShadowCache.cpp",
222 "Texture.cpp",
223 "TextureCache.cpp",
224 "VectorDrawable.cpp",
225 "VkLayer.cpp",
226 "protos/hwui.proto",
227 ],
228
229 proto: {
230 export_proto_headers: true,
231 },
232
233 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700234 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700235}
236
237cc_library {
238 name: "libhwui",
Chris Craikd17b63c2017-06-01 10:45:36 -0700239 defaults: [
240 "libhwui_defaults",
241
242 // Enables fine-grained GLES error checking
243 // If enabled, every GLES call is wrapped & error checked
244 // Has moderate overhead
245 "hwui_enable_opengl_validation",
246],
Colin Crossf6298102017-04-19 15:25:25 -0700247}
248
249// ------------------------
250// static library null gpu
251// ------------------------
252
253cc_library_static {
254 name: "libhwui_static_debug",
255 defaults: [
256 "libhwui_defaults",
257 "hwui_debug",
258 ],
259 cflags: ["-DHWUI_NULL_GPU"],
260 srcs: [
261 "debug/nullegl.cpp",
262 ],
Colin Crossf6298102017-04-19 15:25:25 -0700263}
264
265cc_defaults {
266 name: "hwui_test_defaults",
267 defaults: ["hwui_defaults"],
268 test_suites: ["device-tests"],
269 srcs: [
270 "tests/common/scenes/*.cpp",
271 "tests/common/LeakChecker.cpp",
272 "tests/common/TestListViewSceneBase.cpp",
273 "tests/common/TestContext.cpp",
274 "tests/common/TestScene.cpp",
275 "tests/common/TestUtils.cpp",
276 ],
277}
278
279// ------------------------
280// unit tests
281// ------------------------
282
283cc_test {
284 name: "hwui_unit_tests",
285 defaults: ["hwui_test_defaults"],
286
287 static_libs: [
288 "libgmock",
289 "libhwui_static_debug",
290 ],
291 shared_libs: ["libmemunreachable"],
292 cflags: [
293 "-include debug/wrap_gles.h",
294 "-DHWUI_NULL_GPU",
295 ],
296
297 srcs: [
298 "tests/unit/main.cpp",
299 "tests/unit/BakedOpDispatcherTests.cpp",
300 "tests/unit/BakedOpRendererTests.cpp",
301 "tests/unit/BakedOpStateTests.cpp",
302 "tests/unit/BitmapTests.cpp",
303 "tests/unit/CanvasContextTests.cpp",
304 "tests/unit/CanvasStateTests.cpp",
305 "tests/unit/ClipAreaTests.cpp",
306 "tests/unit/DamageAccumulatorTests.cpp",
307 "tests/unit/DeferredLayerUpdaterTests.cpp",
308 "tests/unit/DeviceInfoTests.cpp",
309 "tests/unit/FatVectorTests.cpp",
310 "tests/unit/FontRendererTests.cpp",
311 "tests/unit/FrameBuilderTests.cpp",
312 "tests/unit/GlopBuilderTests.cpp",
313 "tests/unit/GpuMemoryTrackerTests.cpp",
314 "tests/unit/GradientCacheTests.cpp",
315 "tests/unit/GraphicsStatsServiceTests.cpp",
316 "tests/unit/LayerUpdateQueueTests.cpp",
317 "tests/unit/LeakCheckTests.cpp",
318 "tests/unit/LinearAllocatorTests.cpp",
319 "tests/unit/MatrixTests.cpp",
320 "tests/unit/MeshStateTests.cpp",
321 "tests/unit/OffscreenBufferPoolTests.cpp",
322 "tests/unit/OpDumperTests.cpp",
323 "tests/unit/PathInterpolatorTests.cpp",
324 "tests/unit/RenderNodeDrawableTests.cpp",
325 "tests/unit/RecordingCanvasTests.cpp",
326 "tests/unit/RenderNodeTests.cpp",
327 "tests/unit/RenderPropertiesTests.cpp",
328 "tests/unit/SkiaBehaviorTests.cpp",
329 "tests/unit/SkiaDisplayListTests.cpp",
330 "tests/unit/SkiaPipelineTests.cpp",
331 "tests/unit/SkiaRenderPropertiesTests.cpp",
332 "tests/unit/SkiaCanvasTests.cpp",
333 "tests/unit/SnapshotTests.cpp",
334 "tests/unit/StringUtilsTests.cpp",
335 "tests/unit/TestUtilsTests.cpp",
336 "tests/unit/TextDropShadowCacheTests.cpp",
337 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700338 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700339 "tests/unit/VectorDrawableTests.cpp",
340 ],
341}
342
343// ------------------------
344// Macro-bench app
345// ------------------------
346
347cc_benchmark {
348 name: "hwuimacro",
349 defaults: ["hwui_test_defaults"],
350
351 // set to libhwui_static_debug to skip actual GL commands
352 whole_static_libs: ["libhwui"],
353 shared_libs: ["libmemunreachable"],
354
355 srcs: [
356 "tests/macrobench/TestSceneRunner.cpp",
357 "tests/macrobench/main.cpp",
358 ],
359}
360
361// ------------------------
362// Micro-bench app
363// ---------------------
364
365cc_benchmark {
366 name: "hwuimicro",
367 defaults: ["hwui_test_defaults"],
368
369 cflags: [
370 "-include debug/wrap_gles.h",
371 "-DHWUI_NULL_GPU",
372 ],
373
374 whole_static_libs: ["libhwui_static_debug"],
375 shared_libs: ["libmemunreachable"],
376
377 srcs: [
378 "tests/microbench/main.cpp",
379 "tests/microbench/DisplayListCanvasBench.cpp",
380 "tests/microbench/FontBench.cpp",
381 "tests/microbench/FrameBuilderBench.cpp",
382 "tests/microbench/LinearAllocatorBench.cpp",
383 "tests/microbench/PathParserBench.cpp",
384 "tests/microbench/RenderNodeBench.cpp",
385 "tests/microbench/ShadowBench.cpp",
386 "tests/microbench/TaskManagerBench.cpp",
387 ],
388}