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