blob: 23a207ed8e9788b70fb416a67851f29bc1cb36cf [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",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400150 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700151 "renderthread/CanvasContext.cpp",
152 "renderthread/OpenGLPipeline.cpp",
153 "renderthread/DrawFrameTask.cpp",
154 "renderthread/EglManager.cpp",
155 "renderthread/VulkanManager.cpp",
156 "renderthread/RenderProxy.cpp",
157 "renderthread/RenderTask.cpp",
158 "renderthread/RenderThread.cpp",
159 "renderthread/TimeLord.cpp",
160 "renderthread/Frame.cpp",
161 "service/GraphicsStatsService.cpp",
162 "thread/TaskManager.cpp",
163 "utils/Blur.cpp",
164 "utils/Color.cpp",
165 "utils/GLUtils.cpp",
166 "utils/LinearAllocator.cpp",
167 "utils/StringUtils.cpp",
168 "utils/TestWindowContext.cpp",
169 "utils/VectorDrawableUtils.cpp",
170 "AmbientShadow.cpp",
171 "AnimationContext.cpp",
172 "Animator.cpp",
173 "AnimatorManager.cpp",
174 "BakedOpDispatcher.cpp",
175 "BakedOpRenderer.cpp",
176 "BakedOpState.cpp",
177 "Caches.cpp",
178 "CanvasState.cpp",
179 "ClipArea.cpp",
180 "DamageAccumulator.cpp",
181 "DeferredLayerUpdater.cpp",
182 "DeviceInfo.cpp",
183 "DisplayList.cpp",
184 "Extensions.cpp",
185 "FboCache.cpp",
186 "FontRenderer.cpp",
187 "FrameBuilder.cpp",
188 "FrameInfo.cpp",
189 "FrameInfoVisualizer.cpp",
190 "GammaFontRenderer.cpp",
191 "GlLayer.cpp",
192 "GlopBuilder.cpp",
193 "GpuMemoryTracker.cpp",
194 "GradientCache.cpp",
195 "Image.cpp",
196 "Interpolator.cpp",
197 "JankTracker.cpp",
198 "Layer.cpp",
199 "LayerBuilder.cpp",
200 "LayerUpdateQueue.cpp",
201 "Matrix.cpp",
202 "OpDumper.cpp",
203 "OpenGLReadback.cpp",
204 "Patch.cpp",
205 "PatchCache.cpp",
206 "PathCache.cpp",
207 "PathParser.cpp",
208 "PathTessellator.cpp",
209 "PixelBuffer.cpp",
210 "ProfileRenderer.cpp",
211 "Program.cpp",
212 "ProgramCache.cpp",
213 "Properties.cpp",
214 "PropertyValuesAnimatorSet.cpp",
215 "PropertyValuesHolder.cpp",
216 "RecordingCanvas.cpp",
217 "RenderBufferCache.cpp",
218 "RenderNode.cpp",
219 "RenderProperties.cpp",
220 "ResourceCache.cpp",
221 "ShadowTessellator.cpp",
222 "SkiaCanvas.cpp",
223 "SkiaCanvasProxy.cpp",
224 "SkiaShader.cpp",
225 "Snapshot.cpp",
226 "SpotShadow.cpp",
227 "TessellationCache.cpp",
228 "TextDropShadowCache.cpp",
229 "Texture.cpp",
230 "TextureCache.cpp",
231 "VectorDrawable.cpp",
232 "VkLayer.cpp",
233 "protos/hwui.proto",
234 ],
235
236 proto: {
237 export_proto_headers: true,
238 },
239
240 export_include_dirs: ["."],
Colin Cross3f8fd402017-04-20 12:20:20 -0700241 export_shared_lib_headers: ["libRScpp"],
Colin Crossf6298102017-04-19 15:25:25 -0700242}
243
244cc_library {
245 name: "libhwui",
246 defaults: ["libhwui_defaults"],
247}
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",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400303 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700304 "tests/unit/CanvasContextTests.cpp",
305 "tests/unit/CanvasStateTests.cpp",
306 "tests/unit/ClipAreaTests.cpp",
307 "tests/unit/DamageAccumulatorTests.cpp",
308 "tests/unit/DeferredLayerUpdaterTests.cpp",
309 "tests/unit/DeviceInfoTests.cpp",
310 "tests/unit/FatVectorTests.cpp",
311 "tests/unit/FontRendererTests.cpp",
312 "tests/unit/FrameBuilderTests.cpp",
313 "tests/unit/GlopBuilderTests.cpp",
314 "tests/unit/GpuMemoryTrackerTests.cpp",
315 "tests/unit/GradientCacheTests.cpp",
316 "tests/unit/GraphicsStatsServiceTests.cpp",
317 "tests/unit/LayerUpdateQueueTests.cpp",
318 "tests/unit/LeakCheckTests.cpp",
319 "tests/unit/LinearAllocatorTests.cpp",
320 "tests/unit/MatrixTests.cpp",
321 "tests/unit/MeshStateTests.cpp",
322 "tests/unit/OffscreenBufferPoolTests.cpp",
323 "tests/unit/OpDumperTests.cpp",
324 "tests/unit/PathInterpolatorTests.cpp",
325 "tests/unit/RenderNodeDrawableTests.cpp",
326 "tests/unit/RecordingCanvasTests.cpp",
327 "tests/unit/RenderNodeTests.cpp",
328 "tests/unit/RenderPropertiesTests.cpp",
329 "tests/unit/SkiaBehaviorTests.cpp",
330 "tests/unit/SkiaDisplayListTests.cpp",
331 "tests/unit/SkiaPipelineTests.cpp",
332 "tests/unit/SkiaRenderPropertiesTests.cpp",
333 "tests/unit/SkiaCanvasTests.cpp",
334 "tests/unit/SnapshotTests.cpp",
335 "tests/unit/StringUtilsTests.cpp",
336 "tests/unit/TestUtilsTests.cpp",
337 "tests/unit/TextDropShadowCacheTests.cpp",
338 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700339 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700340 "tests/unit/VectorDrawableTests.cpp",
341 ],
342}
343
344// ------------------------
345// Macro-bench app
346// ------------------------
347
348cc_benchmark {
349 name: "hwuimacro",
350 defaults: ["hwui_test_defaults"],
351
352 // set to libhwui_static_debug to skip actual GL commands
353 whole_static_libs: ["libhwui"],
354 shared_libs: ["libmemunreachable"],
355
356 srcs: [
357 "tests/macrobench/TestSceneRunner.cpp",
358 "tests/macrobench/main.cpp",
359 ],
360}
361
362// ------------------------
363// Micro-bench app
364// ---------------------
365
366cc_benchmark {
367 name: "hwuimicro",
368 defaults: ["hwui_test_defaults"],
369
370 cflags: [
371 "-include debug/wrap_gles.h",
372 "-DHWUI_NULL_GPU",
373 ],
374
375 whole_static_libs: ["libhwui_static_debug"],
376 shared_libs: ["libmemunreachable"],
377
378 srcs: [
379 "tests/microbench/main.cpp",
380 "tests/microbench/DisplayListCanvasBench.cpp",
381 "tests/microbench/FontBench.cpp",
382 "tests/microbench/FrameBuilderBench.cpp",
383 "tests/microbench/LinearAllocatorBench.cpp",
384 "tests/microbench/PathParserBench.cpp",
385 "tests/microbench/RenderNodeBench.cpp",
386 "tests/microbench/ShadowBench.cpp",
387 "tests/microbench/TaskManagerBench.cpp",
388 ],
389}