1 cc_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 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 "external/skia/src/gpu", 40 ], 41 42 product_variables: { 43 device_uses_hwc2: { 44 cflags: ["-DUSE_HWC2"], 45 }, 46 }, 47 } 48 49 cc_defaults { 50 name: "hwui_static_deps", 51 shared_libs: [ 52 "liblog", 53 "libcutils", 54 "libutils", 55 "libEGL", 56 "libGLESv2", 57 "libvulkan", 58 "libskia", 59 "libui", 60 "libgui", 61 "libprotobuf-cpp-lite", 62 "libharfbuzz_ng", 63 "libft2", 64 "libminikin", 65 "libandroidfw", 66 "libRScpp", 67 ], 68 static_libs: [ 69 "libplatformprotos", 70 ], 71 } 72 73 cc_defaults { 74 name: "hwui_bugreport_font_cache_usage", 75 srcs: ["font/FontCacheHistoryTracker.cpp"], 76 cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"], 77 } 78 79 cc_defaults { 80 name: "hwui_compile_for_perf", 81 // TODO: Non-arm? 82 cflags: [ 83 "-fno-omit-frame-pointer", 84 "-marm", 85 "-mapcs", 86 ], 87 } 88 89 cc_defaults { 90 name: "hwui_debug", 91 cflags: ["-include debug/wrap_gles.h"], 92 srcs: [ 93 "debug/wrap_gles.cpp", 94 "debug/DefaultGlesDriver.cpp", 95 "debug/GlesErrorCheckWrapper.cpp", 96 "debug/GlesDriver.cpp", 97 "debug/FatalBaseDriver.cpp", 98 "debug/NullGlesDriver.cpp", 99 ], 100 include_dirs: ["frameworks/native/opengl/libs/GLES2"], 101 } 102 103 cc_defaults { 104 name: "hwui_enable_opengl_validation", 105 defaults: ["hwui_debug"], 106 cflags: ["-DDEBUG_OPENGL=3"], 107 include_dirs: ["frameworks/native/opengl/libs/GLES2"], 108 } 109 110 // ------------------------ 111 // library 112 // ------------------------ 113 114 cc_defaults { 115 name: "libhwui_defaults", 116 defaults: ["hwui_defaults"], 117 srcs: [ 118 "hwui/Bitmap.cpp", 119 "font/CacheTexture.cpp", 120 "font/Font.cpp", 121 "hwui/Canvas.cpp", 122 "hwui/MinikinSkia.cpp", 123 "hwui/MinikinUtils.cpp", 124 "hwui/PaintImpl.cpp", 125 "hwui/Typeface.cpp", 126 "pipeline/skia/GLFunctorDrawable.cpp", 127 "pipeline/skia/LayerDrawable.cpp", 128 "pipeline/skia/RenderNodeDrawable.cpp", 129 "pipeline/skia/ReorderBarrierDrawables.cpp", 130 "pipeline/skia/SkiaDisplayList.cpp", 131 "pipeline/skia/SkiaOpenGLPipeline.cpp", 132 "pipeline/skia/SkiaOpenGLReadback.cpp", 133 "pipeline/skia/SkiaPipeline.cpp", 134 "pipeline/skia/SkiaProfileRenderer.cpp", 135 "pipeline/skia/SkiaRecordingCanvas.cpp", 136 "pipeline/skia/SkiaVulkanPipeline.cpp", 137 "pipeline/skia/VectorDrawableAtlas.cpp", 138 "renderstate/Blend.cpp", 139 "renderstate/MeshState.cpp", 140 "renderstate/OffscreenBufferPool.cpp", 141 "renderstate/PixelBufferState.cpp", 142 "renderstate/RenderState.cpp", 143 "renderstate/Scissor.cpp", 144 "renderstate/Stencil.cpp", 145 "renderstate/TextureState.cpp", 146 "renderthread/CacheManager.cpp", 147 "renderthread/CanvasContext.cpp", 148 "renderthread/OpenGLPipeline.cpp", 149 "renderthread/DrawFrameTask.cpp", 150 "renderthread/EglManager.cpp", 151 "renderthread/VulkanManager.cpp", 152 "renderthread/RenderProxy.cpp", 153 "renderthread/RenderTask.cpp", 154 "renderthread/RenderThread.cpp", 155 "renderthread/TimeLord.cpp", 156 "renderthread/Frame.cpp", 157 "service/GraphicsStatsService.cpp", 158 "thread/TaskManager.cpp", 159 "utils/Blur.cpp", 160 "utils/Color.cpp", 161 "utils/GLUtils.cpp", 162 "utils/LinearAllocator.cpp", 163 "utils/StringUtils.cpp", 164 "utils/TestWindowContext.cpp", 165 "utils/VectorDrawableUtils.cpp", 166 "AmbientShadow.cpp", 167 "AnimationContext.cpp", 168 "Animator.cpp", 169 "AnimatorManager.cpp", 170 "BakedOpDispatcher.cpp", 171 "BakedOpRenderer.cpp", 172 "BakedOpState.cpp", 173 "Caches.cpp", 174 "CanvasState.cpp", 175 "ClipArea.cpp", 176 "DamageAccumulator.cpp", 177 "DeferredLayerUpdater.cpp", 178 "DeviceInfo.cpp", 179 "DisplayList.cpp", 180 "Extensions.cpp", 181 "FboCache.cpp", 182 "FontRenderer.cpp", 183 "FrameBuilder.cpp", 184 "FrameInfo.cpp", 185 "FrameInfoVisualizer.cpp", 186 "GammaFontRenderer.cpp", 187 "GlLayer.cpp", 188 "GlopBuilder.cpp", 189 "GpuMemoryTracker.cpp", 190 "GradientCache.cpp", 191 "Image.cpp", 192 "Interpolator.cpp", 193 "JankTracker.cpp", 194 "Layer.cpp", 195 "LayerBuilder.cpp", 196 "LayerUpdateQueue.cpp", 197 "Matrix.cpp", 198 "OpDumper.cpp", 199 "OpenGLReadback.cpp", 200 "Patch.cpp", 201 "PatchCache.cpp", 202 "PathCache.cpp", 203 "PathParser.cpp", 204 "PathTessellator.cpp", 205 "PixelBuffer.cpp", 206 "ProfileData.cpp", 207 "ProfileDataContainer.cpp", 208 "ProfileRenderer.cpp", 209 "Program.cpp", 210 "ProgramCache.cpp", 211 "Properties.cpp", 212 "PropertyValuesAnimatorSet.cpp", 213 "PropertyValuesHolder.cpp", 214 "RecordingCanvas.cpp", 215 "RenderBufferCache.cpp", 216 "RenderNode.cpp", 217 "RenderProperties.cpp", 218 "ResourceCache.cpp", 219 "ShadowTessellator.cpp", 220 "SkiaCanvas.cpp", 221 "SkiaCanvasProxy.cpp", 222 "SkiaShader.cpp", 223 "Snapshot.cpp", 224 "SpotShadow.cpp", 225 "TessellationCache.cpp", 226 "TextDropShadowCache.cpp", 227 "Texture.cpp", 228 "TextureCache.cpp", 229 "VectorDrawable.cpp", 230 "VkLayer.cpp", 231 "protos/hwui.proto", 232 ], 233 234 proto: { 235 export_proto_headers: true, 236 }, 237 238 export_include_dirs: ["."], 239 export_shared_lib_headers: ["libRScpp"], 240 } 241 242 cc_library { 243 name: "libhwui", 244 defaults: [ 245 "libhwui_defaults", 246 247 // Enables fine-grained GLES error checking 248 // If enabled, every GLES call is wrapped & error checked 249 // Has moderate overhead 250 "hwui_enable_opengl_validation", 251 ], 252 } 253 254 // ------------------------ 255 // static library null gpu 256 // ------------------------ 257 258 cc_library_static { 259 name: "libhwui_static_debug", 260 defaults: [ 261 "libhwui_defaults", 262 "hwui_debug", 263 ], 264 cflags: ["-DHWUI_NULL_GPU"], 265 srcs: [ 266 "debug/nullegl.cpp", 267 ], 268 } 269 270 cc_defaults { 271 name: "hwui_test_defaults", 272 defaults: ["hwui_defaults"], 273 test_suites: ["device-tests"], 274 srcs: [ 275 "tests/common/scenes/*.cpp", 276 "tests/common/LeakChecker.cpp", 277 "tests/common/TestListViewSceneBase.cpp", 278 "tests/common/TestContext.cpp", 279 "tests/common/TestScene.cpp", 280 "tests/common/TestUtils.cpp", 281 ], 282 } 283 284 // ------------------------ 285 // unit tests 286 // ------------------------ 287 288 cc_test { 289 name: "hwui_unit_tests", 290 defaults: ["hwui_test_defaults"], 291 292 static_libs: [ 293 "libgmock", 294 "libhwui_static_debug", 295 ], 296 shared_libs: ["libmemunreachable"], 297 cflags: [ 298 "-include debug/wrap_gles.h", 299 "-DHWUI_NULL_GPU", 300 ], 301 302 srcs: [ 303 "tests/unit/main.cpp", 304 "tests/unit/BakedOpDispatcherTests.cpp", 305 "tests/unit/BakedOpRendererTests.cpp", 306 "tests/unit/BakedOpStateTests.cpp", 307 "tests/unit/CacheManagerTests.cpp", 308 "tests/unit/CanvasContextTests.cpp", 309 "tests/unit/CanvasStateTests.cpp", 310 "tests/unit/ClipAreaTests.cpp", 311 "tests/unit/DamageAccumulatorTests.cpp", 312 "tests/unit/DeferredLayerUpdaterTests.cpp", 313 "tests/unit/DeviceInfoTests.cpp", 314 "tests/unit/FatVectorTests.cpp", 315 "tests/unit/FontRendererTests.cpp", 316 "tests/unit/FrameBuilderTests.cpp", 317 "tests/unit/GlopBuilderTests.cpp", 318 "tests/unit/GpuMemoryTrackerTests.cpp", 319 "tests/unit/GradientCacheTests.cpp", 320 "tests/unit/GraphicsStatsServiceTests.cpp", 321 "tests/unit/LayerUpdateQueueTests.cpp", 322 "tests/unit/LeakCheckTests.cpp", 323 "tests/unit/LinearAllocatorTests.cpp", 324 "tests/unit/MatrixTests.cpp", 325 "tests/unit/MeshStateTests.cpp", 326 "tests/unit/OffscreenBufferPoolTests.cpp", 327 "tests/unit/OpDumperTests.cpp", 328 "tests/unit/PathInterpolatorTests.cpp", 329 "tests/unit/RenderNodeDrawableTests.cpp", 330 "tests/unit/RecordingCanvasTests.cpp", 331 "tests/unit/RenderNodeTests.cpp", 332 "tests/unit/RenderPropertiesTests.cpp", 333 "tests/unit/SkiaBehaviorTests.cpp", 334 "tests/unit/SkiaDisplayListTests.cpp", 335 "tests/unit/SkiaPipelineTests.cpp", 336 "tests/unit/SkiaRenderPropertiesTests.cpp", 337 "tests/unit/SkiaCanvasTests.cpp", 338 "tests/unit/SnapshotTests.cpp", 339 "tests/unit/StringUtilsTests.cpp", 340 "tests/unit/TestUtilsTests.cpp", 341 "tests/unit/TextDropShadowCacheTests.cpp", 342 "tests/unit/TextureCacheTests.cpp", 343 "tests/unit/TypefaceTests.cpp", 344 "tests/unit/VectorDrawableTests.cpp", 345 "tests/unit/VectorDrawableAtlasTests.cpp", 346 ], 347 } 348 349 // ------------------------ 350 // Macro-bench app 351 // ------------------------ 352 353 cc_benchmark { 354 name: "hwuimacro", 355 defaults: ["hwui_test_defaults"], 356 357 // set to libhwui_static_debug to skip actual GL commands 358 whole_static_libs: ["libhwui"], 359 shared_libs: ["libmemunreachable"], 360 361 srcs: [ 362 "tests/macrobench/TestSceneRunner.cpp", 363 "tests/macrobench/main.cpp", 364 ], 365 } 366 367 // ------------------------ 368 // Micro-bench app 369 // --------------------- 370 371 cc_benchmark { 372 name: "hwuimicro", 373 defaults: ["hwui_test_defaults"], 374 375 cflags: [ 376 "-include debug/wrap_gles.h", 377 "-DHWUI_NULL_GPU", 378 ], 379 380 whole_static_libs: ["libhwui_static_debug"], 381 shared_libs: ["libmemunreachable"], 382 383 srcs: [ 384 "tests/microbench/main.cpp", 385 "tests/microbench/DisplayListCanvasBench.cpp", 386 "tests/microbench/FontBench.cpp", 387 "tests/microbench/FrameBuilderBench.cpp", 388 "tests/microbench/LinearAllocatorBench.cpp", 389 "tests/microbench/PathParserBench.cpp", 390 "tests/microbench/RenderNodeBench.cpp", 391 "tests/microbench/ShadowBench.cpp", 392 "tests/microbench/TaskManagerBench.cpp", 393 ], 394 } 395