blob: 124182f0336e78a72dafb574098ca9a2542f16ad [file] [log] [blame]
Colin Crossf6298102017-04-19 15:25:25 -07001cc_defaults {
2 name: "hwui_defaults",
3 defaults: [
4 "hwui_static_deps",
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -04005 "skia_deps"
Colin Crossf6298102017-04-19 15:25:25 -07006 //"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",
Stan Iliev3310fb12017-03-23 16:56:51 -040039 "external/skia/src/gpu",
Colin Crossf6298102017-04-19 15:25:25 -070040 ],
41
42 product_variables: {
43 device_uses_hwc2: {
44 cflags: ["-DUSE_HWC2"],
45 },
46 },
47}
48
49cc_defaults {
50 name: "hwui_static_deps",
51 shared_libs: [
52 "liblog",
53 "libcutils",
54 "libutils",
55 "libEGL",
56 "libGLESv2",
57 "libvulkan",
Colin Crossf6298102017-04-19 15:25:25 -070058 "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"],
Derek Sollenbergerd938e5a2017-07-24 09:42:07 -0400116
117 whole_static_libs: ["libskia"],
118
Colin Crossf6298102017-04-19 15:25:25 -0700119 srcs: [
120 "hwui/Bitmap.cpp",
121 "font/CacheTexture.cpp",
122 "font/Font.cpp",
123 "hwui/Canvas.cpp",
124 "hwui/MinikinSkia.cpp",
125 "hwui/MinikinUtils.cpp",
126 "hwui/PaintImpl.cpp",
127 "hwui/Typeface.cpp",
128 "pipeline/skia/GLFunctorDrawable.cpp",
129 "pipeline/skia/LayerDrawable.cpp",
130 "pipeline/skia/RenderNodeDrawable.cpp",
131 "pipeline/skia/ReorderBarrierDrawables.cpp",
132 "pipeline/skia/SkiaDisplayList.cpp",
133 "pipeline/skia/SkiaOpenGLPipeline.cpp",
134 "pipeline/skia/SkiaOpenGLReadback.cpp",
135 "pipeline/skia/SkiaPipeline.cpp",
136 "pipeline/skia/SkiaProfileRenderer.cpp",
137 "pipeline/skia/SkiaRecordingCanvas.cpp",
138 "pipeline/skia/SkiaVulkanPipeline.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400139 "pipeline/skia/VectorDrawableAtlas.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700140 "renderstate/Blend.cpp",
141 "renderstate/MeshState.cpp",
142 "renderstate/OffscreenBufferPool.cpp",
143 "renderstate/PixelBufferState.cpp",
144 "renderstate/RenderState.cpp",
145 "renderstate/Scissor.cpp",
146 "renderstate/Stencil.cpp",
147 "renderstate/TextureState.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400148 "renderthread/CacheManager.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700149 "renderthread/CanvasContext.cpp",
150 "renderthread/OpenGLPipeline.cpp",
151 "renderthread/DrawFrameTask.cpp",
152 "renderthread/EglManager.cpp",
153 "renderthread/VulkanManager.cpp",
154 "renderthread/RenderProxy.cpp",
155 "renderthread/RenderTask.cpp",
156 "renderthread/RenderThread.cpp",
157 "renderthread/TimeLord.cpp",
158 "renderthread/Frame.cpp",
159 "service/GraphicsStatsService.cpp",
160 "thread/TaskManager.cpp",
161 "utils/Blur.cpp",
162 "utils/Color.cpp",
163 "utils/GLUtils.cpp",
164 "utils/LinearAllocator.cpp",
165 "utils/StringUtils.cpp",
166 "utils/TestWindowContext.cpp",
167 "utils/VectorDrawableUtils.cpp",
168 "AmbientShadow.cpp",
169 "AnimationContext.cpp",
170 "Animator.cpp",
171 "AnimatorManager.cpp",
172 "BakedOpDispatcher.cpp",
173 "BakedOpRenderer.cpp",
174 "BakedOpState.cpp",
175 "Caches.cpp",
176 "CanvasState.cpp",
177 "ClipArea.cpp",
178 "DamageAccumulator.cpp",
179 "DeferredLayerUpdater.cpp",
180 "DeviceInfo.cpp",
181 "DisplayList.cpp",
182 "Extensions.cpp",
183 "FboCache.cpp",
184 "FontRenderer.cpp",
185 "FrameBuilder.cpp",
186 "FrameInfo.cpp",
187 "FrameInfoVisualizer.cpp",
188 "GammaFontRenderer.cpp",
189 "GlLayer.cpp",
190 "GlopBuilder.cpp",
191 "GpuMemoryTracker.cpp",
192 "GradientCache.cpp",
193 "Image.cpp",
194 "Interpolator.cpp",
195 "JankTracker.cpp",
196 "Layer.cpp",
197 "LayerBuilder.cpp",
198 "LayerUpdateQueue.cpp",
199 "Matrix.cpp",
200 "OpDumper.cpp",
201 "OpenGLReadback.cpp",
202 "Patch.cpp",
203 "PatchCache.cpp",
204 "PathCache.cpp",
205 "PathParser.cpp",
206 "PathTessellator.cpp",
207 "PixelBuffer.cpp",
John Reck7075c792017-07-05 14:03:43 -0700208 "ProfileData.cpp",
John Reck34781b22017-07-05 16:39:36 -0700209 "ProfileDataContainer.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700210 "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",
Chris Craikd17b63c2017-06-01 10:45:36 -0700246 defaults: [
247 "libhwui_defaults",
248
249 // Enables fine-grained GLES error checking
250 // If enabled, every GLES call is wrapped & error checked
251 // Has moderate overhead
252 "hwui_enable_opengl_validation",
253],
Colin Crossf6298102017-04-19 15:25:25 -0700254}
255
256// ------------------------
257// static library null gpu
258// ------------------------
259
260cc_library_static {
261 name: "libhwui_static_debug",
262 defaults: [
263 "libhwui_defaults",
264 "hwui_debug",
265 ],
266 cflags: ["-DHWUI_NULL_GPU"],
267 srcs: [
268 "debug/nullegl.cpp",
269 ],
Colin Crossf6298102017-04-19 15:25:25 -0700270}
271
272cc_defaults {
273 name: "hwui_test_defaults",
274 defaults: ["hwui_defaults"],
275 test_suites: ["device-tests"],
276 srcs: [
277 "tests/common/scenes/*.cpp",
278 "tests/common/LeakChecker.cpp",
279 "tests/common/TestListViewSceneBase.cpp",
280 "tests/common/TestContext.cpp",
281 "tests/common/TestScene.cpp",
282 "tests/common/TestUtils.cpp",
283 ],
284}
285
286// ------------------------
287// unit tests
288// ------------------------
289
290cc_test {
291 name: "hwui_unit_tests",
292 defaults: ["hwui_test_defaults"],
293
294 static_libs: [
295 "libgmock",
296 "libhwui_static_debug",
297 ],
298 shared_libs: ["libmemunreachable"],
299 cflags: [
300 "-include debug/wrap_gles.h",
301 "-DHWUI_NULL_GPU",
302 ],
303
304 srcs: [
305 "tests/unit/main.cpp",
306 "tests/unit/BakedOpDispatcherTests.cpp",
307 "tests/unit/BakedOpRendererTests.cpp",
308 "tests/unit/BakedOpStateTests.cpp",
Derek Sollenbergerf9e45d12017-06-01 13:07:39 -0400309 "tests/unit/CacheManagerTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700310 "tests/unit/CanvasContextTests.cpp",
311 "tests/unit/CanvasStateTests.cpp",
312 "tests/unit/ClipAreaTests.cpp",
313 "tests/unit/DamageAccumulatorTests.cpp",
314 "tests/unit/DeferredLayerUpdaterTests.cpp",
315 "tests/unit/DeviceInfoTests.cpp",
316 "tests/unit/FatVectorTests.cpp",
317 "tests/unit/FontRendererTests.cpp",
318 "tests/unit/FrameBuilderTests.cpp",
319 "tests/unit/GlopBuilderTests.cpp",
320 "tests/unit/GpuMemoryTrackerTests.cpp",
321 "tests/unit/GradientCacheTests.cpp",
322 "tests/unit/GraphicsStatsServiceTests.cpp",
323 "tests/unit/LayerUpdateQueueTests.cpp",
324 "tests/unit/LeakCheckTests.cpp",
325 "tests/unit/LinearAllocatorTests.cpp",
326 "tests/unit/MatrixTests.cpp",
327 "tests/unit/MeshStateTests.cpp",
328 "tests/unit/OffscreenBufferPoolTests.cpp",
329 "tests/unit/OpDumperTests.cpp",
330 "tests/unit/PathInterpolatorTests.cpp",
331 "tests/unit/RenderNodeDrawableTests.cpp",
332 "tests/unit/RecordingCanvasTests.cpp",
333 "tests/unit/RenderNodeTests.cpp",
334 "tests/unit/RenderPropertiesTests.cpp",
335 "tests/unit/SkiaBehaviorTests.cpp",
336 "tests/unit/SkiaDisplayListTests.cpp",
337 "tests/unit/SkiaPipelineTests.cpp",
338 "tests/unit/SkiaRenderPropertiesTests.cpp",
339 "tests/unit/SkiaCanvasTests.cpp",
340 "tests/unit/SnapshotTests.cpp",
341 "tests/unit/StringUtilsTests.cpp",
342 "tests/unit/TestUtilsTests.cpp",
343 "tests/unit/TextDropShadowCacheTests.cpp",
344 "tests/unit/TextureCacheTests.cpp",
Seigo Nonaka1f9c4612017-05-01 22:17:36 -0700345 "tests/unit/TypefaceTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700346 "tests/unit/VectorDrawableTests.cpp",
Stan Iliev3310fb12017-03-23 16:56:51 -0400347 "tests/unit/VectorDrawableAtlasTests.cpp",
Colin Crossf6298102017-04-19 15:25:25 -0700348 ],
349}
350
351// ------------------------
352// Macro-bench app
353// ------------------------
354
355cc_benchmark {
356 name: "hwuimacro",
357 defaults: ["hwui_test_defaults"],
358
359 // set to libhwui_static_debug to skip actual GL commands
360 whole_static_libs: ["libhwui"],
361 shared_libs: ["libmemunreachable"],
362
363 srcs: [
364 "tests/macrobench/TestSceneRunner.cpp",
365 "tests/macrobench/main.cpp",
366 ],
367}
368
369// ------------------------
370// Micro-bench app
371// ---------------------
372
373cc_benchmark {
374 name: "hwuimicro",
375 defaults: ["hwui_test_defaults"],
376
377 cflags: [
378 "-include debug/wrap_gles.h",
379 "-DHWUI_NULL_GPU",
380 ],
381
382 whole_static_libs: ["libhwui_static_debug"],
383 shared_libs: ["libmemunreachable"],
384
385 srcs: [
386 "tests/microbench/main.cpp",
387 "tests/microbench/DisplayListCanvasBench.cpp",
388 "tests/microbench/FontBench.cpp",
389 "tests/microbench/FrameBuilderBench.cpp",
390 "tests/microbench/LinearAllocatorBench.cpp",
391 "tests/microbench/PathParserBench.cpp",
392 "tests/microbench/RenderNodeBench.cpp",
393 "tests/microbench/ShadowBench.cpp",
394 "tests/microbench/TaskManagerBench.cpp",
395 ],
396}