Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "hwui_defaults", |
| 3 | defaults: [ |
| 4 | "hwui_static_deps", |
Pirama Arumuga Nainar | 0dfd4be | 2017-11-16 22:40:00 -0800 | [diff] [blame] | 5 | "skia_deps", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 6 | //"hwui_bugreport_font_cache_usage", |
| 7 | //"hwui_compile_for_perf", |
Pirama Arumuga Nainar | 0dfd4be | 2017-11-16 22:40:00 -0800 | [diff] [blame] | 8 | "hwui_pgo", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 9 | ], |
| 10 | |
John Reck | f8441e6 | 2017-10-23 13:10:41 -0700 | [diff] [blame] | 11 | cpp_std: "c++17", |
| 12 | |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 13 | cflags: [ |
| 14 | "-DEGL_EGLEXT_PROTOTYPES", |
| 15 | "-DGL_GLEXT_PROTOTYPES", |
| 16 | "-DATRACE_TAG=ATRACE_TAG_VIEW", |
| 17 | "-DLOG_TAG=\"OpenGLRenderer\"", |
| 18 | "-Wall", |
| 19 | "-Wno-unused-parameter", |
| 20 | "-Wunreachable-code", |
| 21 | "-Werror", |
| 22 | "-fvisibility=hidden", |
| 23 | |
| 24 | // GCC false-positives on this warning, and since we -Werror that's |
| 25 | // a problem |
| 26 | "-Wno-free-nonheap-object", |
| 27 | |
| 28 | // clang's warning is broken, see: https://llvm.org/bugs/show_bug.cgi?id=21629 |
| 29 | "-Wno-missing-braces", |
| 30 | |
| 31 | // TODO: Linear blending should be enabled by default, but we are |
| 32 | // TODO: making it an opt-in while it's a work in progress |
| 33 | //"-DANDROID_ENABLE_LINEAR_BLENDING", |
| 34 | ], |
| 35 | |
| 36 | include_dirs: [ |
| 37 | "external/skia/include/private", |
| 38 | "external/skia/src/core", |
| 39 | "external/skia/src/effects", |
| 40 | "external/skia/src/image", |
| 41 | "external/skia/src/utils", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 42 | "external/skia/src/gpu", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 43 | ], |
| 44 | |
| 45 | product_variables: { |
| 46 | device_uses_hwc2: { |
| 47 | cflags: ["-DUSE_HWC2"], |
| 48 | }, |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | cc_defaults { |
| 53 | name: "hwui_static_deps", |
| 54 | shared_libs: [ |
| 55 | "liblog", |
| 56 | "libcutils", |
| 57 | "libutils", |
| 58 | "libEGL", |
| 59 | "libGLESv2", |
| 60 | "libvulkan", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 61 | "libui", |
| 62 | "libgui", |
John Reck | 915883b | 2017-05-03 10:27:20 -0700 | [diff] [blame] | 63 | "libprotobuf-cpp-lite", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 64 | "libharfbuzz_ng", |
| 65 | "libft2", |
| 66 | "libminikin", |
| 67 | "libandroidfw", |
| 68 | "libRScpp", |
| 69 | ], |
| 70 | static_libs: [ |
| 71 | "libplatformprotos", |
Stan Iliev | d495f43 | 2017-10-09 15:49:32 -0400 | [diff] [blame] | 72 | "libEGL_blobCache", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 73 | ], |
| 74 | } |
| 75 | |
| 76 | cc_defaults { |
| 77 | name: "hwui_bugreport_font_cache_usage", |
| 78 | srcs: ["font/FontCacheHistoryTracker.cpp"], |
| 79 | cflags: ["-DBUGREPORT_FONT_CACHE_USAGE"], |
| 80 | } |
| 81 | |
| 82 | cc_defaults { |
| 83 | name: "hwui_compile_for_perf", |
| 84 | // TODO: Non-arm? |
| 85 | cflags: [ |
| 86 | "-fno-omit-frame-pointer", |
| 87 | "-marm", |
| 88 | "-mapcs", |
| 89 | ], |
| 90 | } |
| 91 | |
| 92 | cc_defaults { |
| 93 | name: "hwui_debug", |
| 94 | cflags: ["-include debug/wrap_gles.h"], |
| 95 | srcs: [ |
| 96 | "debug/wrap_gles.cpp", |
| 97 | "debug/DefaultGlesDriver.cpp", |
| 98 | "debug/GlesErrorCheckWrapper.cpp", |
| 99 | "debug/GlesDriver.cpp", |
| 100 | "debug/FatalBaseDriver.cpp", |
| 101 | "debug/NullGlesDriver.cpp", |
| 102 | ], |
| 103 | include_dirs: ["frameworks/native/opengl/libs/GLES2"], |
| 104 | } |
| 105 | |
| 106 | cc_defaults { |
| 107 | name: "hwui_enable_opengl_validation", |
| 108 | defaults: ["hwui_debug"], |
| 109 | cflags: ["-DDEBUG_OPENGL=3"], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 110 | include_dirs: ["frameworks/native/opengl/libs/GLES2"], |
| 111 | } |
| 112 | |
Pirama Arumuga Nainar | 0dfd4be | 2017-11-16 22:40:00 -0800 | [diff] [blame] | 113 | // Build libhwui with PGO by default. |
| 114 | // Location of PGO profile data is defined in build/soong/cc/pgo.go |
| 115 | // and is separate from hwui. |
| 116 | // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable |
| 117 | // or set enable_profile_use property to false. |
| 118 | cc_defaults { |
| 119 | name: "hwui_pgo", |
| 120 | |
| 121 | pgo: { |
| 122 | instrumentation: true, |
| 123 | profile_file: "hwui/hwui.profdata", |
| 124 | benchmarks: ["hwui"], |
Zhizhou Yang | 58e1b78 | 2017-12-06 16:59:06 -0800 | [diff] [blame] | 125 | enable_profile_use: true, |
Pirama Arumuga Nainar | 0dfd4be | 2017-11-16 22:40:00 -0800 | [diff] [blame] | 126 | }, |
| 127 | } |
| 128 | |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 129 | // ------------------------ |
| 130 | // library |
| 131 | // ------------------------ |
| 132 | |
| 133 | cc_defaults { |
| 134 | name: "libhwui_defaults", |
| 135 | defaults: ["hwui_defaults"], |
Derek Sollenberger | d938e5a | 2017-07-24 09:42:07 -0400 | [diff] [blame] | 136 | |
| 137 | whole_static_libs: ["libskia"], |
| 138 | |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 139 | srcs: [ |
Derek Sollenberger | 2d14213 | 2018-01-22 10:25:26 -0500 | [diff] [blame] | 140 | "hwui/AnimatedImageDrawable.cpp", |
Leon Scroggins III | 5b7f426 | 2018-01-26 11:03:54 -0500 | [diff] [blame^] | 141 | "hwui/AnimatedImageThread.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 142 | "hwui/Bitmap.cpp", |
| 143 | "font/CacheTexture.cpp", |
| 144 | "font/Font.cpp", |
| 145 | "hwui/Canvas.cpp", |
| 146 | "hwui/MinikinSkia.cpp", |
| 147 | "hwui/MinikinUtils.cpp", |
| 148 | "hwui/PaintImpl.cpp", |
| 149 | "hwui/Typeface.cpp", |
| 150 | "pipeline/skia/GLFunctorDrawable.cpp", |
| 151 | "pipeline/skia/LayerDrawable.cpp", |
| 152 | "pipeline/skia/RenderNodeDrawable.cpp", |
| 153 | "pipeline/skia/ReorderBarrierDrawables.cpp", |
Stan Iliev | d495f43 | 2017-10-09 15:49:32 -0400 | [diff] [blame] | 154 | "pipeline/skia/ShaderCache.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 155 | "pipeline/skia/SkiaDisplayList.cpp", |
| 156 | "pipeline/skia/SkiaOpenGLPipeline.cpp", |
| 157 | "pipeline/skia/SkiaOpenGLReadback.cpp", |
| 158 | "pipeline/skia/SkiaPipeline.cpp", |
| 159 | "pipeline/skia/SkiaProfileRenderer.cpp", |
| 160 | "pipeline/skia/SkiaRecordingCanvas.cpp", |
| 161 | "pipeline/skia/SkiaVulkanPipeline.cpp", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 162 | "pipeline/skia/VectorDrawableAtlas.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 163 | "renderstate/Blend.cpp", |
| 164 | "renderstate/MeshState.cpp", |
| 165 | "renderstate/OffscreenBufferPool.cpp", |
| 166 | "renderstate/PixelBufferState.cpp", |
| 167 | "renderstate/RenderState.cpp", |
| 168 | "renderstate/Scissor.cpp", |
| 169 | "renderstate/Stencil.cpp", |
| 170 | "renderstate/TextureState.cpp", |
Derek Sollenberger | f9e45d1 | 2017-06-01 13:07:39 -0400 | [diff] [blame] | 171 | "renderthread/CacheManager.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 172 | "renderthread/CanvasContext.cpp", |
| 173 | "renderthread/OpenGLPipeline.cpp", |
| 174 | "renderthread/DrawFrameTask.cpp", |
| 175 | "renderthread/EglManager.cpp", |
| 176 | "renderthread/VulkanManager.cpp", |
| 177 | "renderthread/RenderProxy.cpp", |
| 178 | "renderthread/RenderTask.cpp", |
| 179 | "renderthread/RenderThread.cpp", |
| 180 | "renderthread/TimeLord.cpp", |
| 181 | "renderthread/Frame.cpp", |
| 182 | "service/GraphicsStatsService.cpp", |
| 183 | "thread/TaskManager.cpp", |
| 184 | "utils/Blur.cpp", |
| 185 | "utils/Color.cpp", |
| 186 | "utils/GLUtils.cpp", |
| 187 | "utils/LinearAllocator.cpp", |
| 188 | "utils/StringUtils.cpp", |
| 189 | "utils/TestWindowContext.cpp", |
| 190 | "utils/VectorDrawableUtils.cpp", |
| 191 | "AmbientShadow.cpp", |
| 192 | "AnimationContext.cpp", |
| 193 | "Animator.cpp", |
| 194 | "AnimatorManager.cpp", |
| 195 | "BakedOpDispatcher.cpp", |
| 196 | "BakedOpRenderer.cpp", |
| 197 | "BakedOpState.cpp", |
| 198 | "Caches.cpp", |
| 199 | "CanvasState.cpp", |
| 200 | "ClipArea.cpp", |
| 201 | "DamageAccumulator.cpp", |
| 202 | "DeferredLayerUpdater.cpp", |
| 203 | "DeviceInfo.cpp", |
| 204 | "DisplayList.cpp", |
| 205 | "Extensions.cpp", |
| 206 | "FboCache.cpp", |
| 207 | "FontRenderer.cpp", |
| 208 | "FrameBuilder.cpp", |
| 209 | "FrameInfo.cpp", |
| 210 | "FrameInfoVisualizer.cpp", |
| 211 | "GammaFontRenderer.cpp", |
| 212 | "GlLayer.cpp", |
| 213 | "GlopBuilder.cpp", |
| 214 | "GpuMemoryTracker.cpp", |
| 215 | "GradientCache.cpp", |
| 216 | "Image.cpp", |
| 217 | "Interpolator.cpp", |
| 218 | "JankTracker.cpp", |
| 219 | "Layer.cpp", |
| 220 | "LayerBuilder.cpp", |
| 221 | "LayerUpdateQueue.cpp", |
| 222 | "Matrix.cpp", |
| 223 | "OpDumper.cpp", |
| 224 | "OpenGLReadback.cpp", |
| 225 | "Patch.cpp", |
| 226 | "PatchCache.cpp", |
| 227 | "PathCache.cpp", |
| 228 | "PathParser.cpp", |
| 229 | "PathTessellator.cpp", |
| 230 | "PixelBuffer.cpp", |
John Reck | 7075c79 | 2017-07-05 14:03:43 -0700 | [diff] [blame] | 231 | "ProfileData.cpp", |
John Reck | 34781b2 | 2017-07-05 16:39:36 -0700 | [diff] [blame] | 232 | "ProfileDataContainer.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 233 | "ProfileRenderer.cpp", |
| 234 | "Program.cpp", |
| 235 | "ProgramCache.cpp", |
| 236 | "Properties.cpp", |
| 237 | "PropertyValuesAnimatorSet.cpp", |
| 238 | "PropertyValuesHolder.cpp", |
| 239 | "RecordingCanvas.cpp", |
| 240 | "RenderBufferCache.cpp", |
| 241 | "RenderNode.cpp", |
| 242 | "RenderProperties.cpp", |
| 243 | "ResourceCache.cpp", |
| 244 | "ShadowTessellator.cpp", |
| 245 | "SkiaCanvas.cpp", |
| 246 | "SkiaCanvasProxy.cpp", |
| 247 | "SkiaShader.cpp", |
| 248 | "Snapshot.cpp", |
| 249 | "SpotShadow.cpp", |
| 250 | "TessellationCache.cpp", |
| 251 | "TextDropShadowCache.cpp", |
| 252 | "Texture.cpp", |
| 253 | "TextureCache.cpp", |
| 254 | "VectorDrawable.cpp", |
| 255 | "VkLayer.cpp", |
| 256 | "protos/hwui.proto", |
| 257 | ], |
| 258 | |
| 259 | proto: { |
| 260 | export_proto_headers: true, |
| 261 | }, |
| 262 | |
| 263 | export_include_dirs: ["."], |
Colin Cross | 3f8fd40 | 2017-04-20 12:20:20 -0700 | [diff] [blame] | 264 | export_shared_lib_headers: ["libRScpp"], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | cc_library { |
| 268 | name: "libhwui", |
Chris Craik | d17b63c | 2017-06-01 10:45:36 -0700 | [diff] [blame] | 269 | defaults: [ |
| 270 | "libhwui_defaults", |
| 271 | |
| 272 | // Enables fine-grained GLES error checking |
| 273 | // If enabled, every GLES call is wrapped & error checked |
| 274 | // Has moderate overhead |
| 275 | "hwui_enable_opengl_validation", |
Zhizhou Yang | 17371ec | 2017-10-13 11:42:13 -0700 | [diff] [blame] | 276 | ], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 277 | } |
| 278 | |
| 279 | // ------------------------ |
| 280 | // static library null gpu |
| 281 | // ------------------------ |
| 282 | |
| 283 | cc_library_static { |
| 284 | name: "libhwui_static_debug", |
| 285 | defaults: [ |
| 286 | "libhwui_defaults", |
| 287 | "hwui_debug", |
| 288 | ], |
| 289 | cflags: ["-DHWUI_NULL_GPU"], |
| 290 | srcs: [ |
| 291 | "debug/nullegl.cpp", |
| 292 | ], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | cc_defaults { |
| 296 | name: "hwui_test_defaults", |
| 297 | defaults: ["hwui_defaults"], |
| 298 | test_suites: ["device-tests"], |
| 299 | srcs: [ |
| 300 | "tests/common/scenes/*.cpp", |
| 301 | "tests/common/LeakChecker.cpp", |
| 302 | "tests/common/TestListViewSceneBase.cpp", |
| 303 | "tests/common/TestContext.cpp", |
| 304 | "tests/common/TestScene.cpp", |
| 305 | "tests/common/TestUtils.cpp", |
| 306 | ], |
| 307 | } |
| 308 | |
| 309 | // ------------------------ |
| 310 | // unit tests |
| 311 | // ------------------------ |
| 312 | |
| 313 | cc_test { |
| 314 | name: "hwui_unit_tests", |
| 315 | defaults: ["hwui_test_defaults"], |
| 316 | |
| 317 | static_libs: [ |
| 318 | "libgmock", |
| 319 | "libhwui_static_debug", |
| 320 | ], |
| 321 | shared_libs: ["libmemunreachable"], |
| 322 | cflags: [ |
| 323 | "-include debug/wrap_gles.h", |
| 324 | "-DHWUI_NULL_GPU", |
| 325 | ], |
| 326 | |
| 327 | srcs: [ |
| 328 | "tests/unit/main.cpp", |
| 329 | "tests/unit/BakedOpDispatcherTests.cpp", |
| 330 | "tests/unit/BakedOpRendererTests.cpp", |
| 331 | "tests/unit/BakedOpStateTests.cpp", |
Derek Sollenberger | f9e45d1 | 2017-06-01 13:07:39 -0400 | [diff] [blame] | 332 | "tests/unit/CacheManagerTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 333 | "tests/unit/CanvasContextTests.cpp", |
| 334 | "tests/unit/CanvasStateTests.cpp", |
| 335 | "tests/unit/ClipAreaTests.cpp", |
| 336 | "tests/unit/DamageAccumulatorTests.cpp", |
| 337 | "tests/unit/DeferredLayerUpdaterTests.cpp", |
| 338 | "tests/unit/DeviceInfoTests.cpp", |
| 339 | "tests/unit/FatVectorTests.cpp", |
| 340 | "tests/unit/FontRendererTests.cpp", |
| 341 | "tests/unit/FrameBuilderTests.cpp", |
| 342 | "tests/unit/GlopBuilderTests.cpp", |
| 343 | "tests/unit/GpuMemoryTrackerTests.cpp", |
| 344 | "tests/unit/GradientCacheTests.cpp", |
| 345 | "tests/unit/GraphicsStatsServiceTests.cpp", |
| 346 | "tests/unit/LayerUpdateQueueTests.cpp", |
| 347 | "tests/unit/LeakCheckTests.cpp", |
| 348 | "tests/unit/LinearAllocatorTests.cpp", |
| 349 | "tests/unit/MatrixTests.cpp", |
| 350 | "tests/unit/MeshStateTests.cpp", |
| 351 | "tests/unit/OffscreenBufferPoolTests.cpp", |
| 352 | "tests/unit/OpDumperTests.cpp", |
| 353 | "tests/unit/PathInterpolatorTests.cpp", |
| 354 | "tests/unit/RenderNodeDrawableTests.cpp", |
| 355 | "tests/unit/RecordingCanvasTests.cpp", |
| 356 | "tests/unit/RenderNodeTests.cpp", |
| 357 | "tests/unit/RenderPropertiesTests.cpp", |
Stan Iliev | d495f43 | 2017-10-09 15:49:32 -0400 | [diff] [blame] | 358 | "tests/unit/ShaderCacheTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 359 | "tests/unit/SkiaBehaviorTests.cpp", |
| 360 | "tests/unit/SkiaDisplayListTests.cpp", |
| 361 | "tests/unit/SkiaPipelineTests.cpp", |
| 362 | "tests/unit/SkiaRenderPropertiesTests.cpp", |
| 363 | "tests/unit/SkiaCanvasTests.cpp", |
| 364 | "tests/unit/SnapshotTests.cpp", |
| 365 | "tests/unit/StringUtilsTests.cpp", |
| 366 | "tests/unit/TestUtilsTests.cpp", |
| 367 | "tests/unit/TextDropShadowCacheTests.cpp", |
| 368 | "tests/unit/TextureCacheTests.cpp", |
John Reck | f8441e6 | 2017-10-23 13:10:41 -0700 | [diff] [blame] | 369 | "tests/unit/ThreadBaseTests.cpp", |
| 370 | "tests/unit/TypefaceTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 371 | "tests/unit/VectorDrawableTests.cpp", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 372 | "tests/unit/VectorDrawableAtlasTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 373 | ], |
| 374 | } |
| 375 | |
| 376 | // ------------------------ |
| 377 | // Macro-bench app |
| 378 | // ------------------------ |
| 379 | |
| 380 | cc_benchmark { |
| 381 | name: "hwuimacro", |
| 382 | defaults: ["hwui_test_defaults"], |
| 383 | |
| 384 | // set to libhwui_static_debug to skip actual GL commands |
| 385 | whole_static_libs: ["libhwui"], |
| 386 | shared_libs: ["libmemunreachable"], |
| 387 | |
| 388 | srcs: [ |
| 389 | "tests/macrobench/TestSceneRunner.cpp", |
| 390 | "tests/macrobench/main.cpp", |
| 391 | ], |
| 392 | } |
| 393 | |
| 394 | // ------------------------ |
| 395 | // Micro-bench app |
| 396 | // --------------------- |
| 397 | |
| 398 | cc_benchmark { |
| 399 | name: "hwuimicro", |
| 400 | defaults: ["hwui_test_defaults"], |
| 401 | |
| 402 | cflags: [ |
| 403 | "-include debug/wrap_gles.h", |
| 404 | "-DHWUI_NULL_GPU", |
| 405 | ], |
| 406 | |
| 407 | whole_static_libs: ["libhwui_static_debug"], |
| 408 | shared_libs: ["libmemunreachable"], |
| 409 | |
| 410 | srcs: [ |
| 411 | "tests/microbench/main.cpp", |
| 412 | "tests/microbench/DisplayListCanvasBench.cpp", |
| 413 | "tests/microbench/FontBench.cpp", |
| 414 | "tests/microbench/FrameBuilderBench.cpp", |
| 415 | "tests/microbench/LinearAllocatorBench.cpp", |
| 416 | "tests/microbench/PathParserBench.cpp", |
| 417 | "tests/microbench/RenderNodeBench.cpp", |
| 418 | "tests/microbench/ShadowBench.cpp", |
| 419 | "tests/microbench/TaskManagerBench.cpp", |
| 420 | ], |
| 421 | } |
Pirama Arumuga Nainar | bc1e177 | 2017-11-17 11:32:16 -0800 | [diff] [blame] | 422 | |
| 423 | // ---------------------------------------- |
| 424 | // Phony target to build benchmarks for PGO |
| 425 | // ---------------------------------------- |
| 426 | |
| 427 | phony { |
| 428 | name: "pgo-targets-hwui", |
| 429 | required: [ |
| 430 | "hwuimicro", |
| 431 | "hwuimacro", |
| 432 | ] |
| 433 | } |