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", |
| 5 | |
| 6 | //"hwui_bugreport_font_cache_usage", |
| 7 | //"hwui_compile_for_perf", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 39 | "external/skia/src/gpu", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
John Reck | 915883b | 2017-05-03 10:27:20 -0700 | [diff] [blame] | 61 | "libprotobuf-cpp-lite", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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"], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 137 | "pipeline/skia/VectorDrawableAtlas.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
Derek Sollenberger | f9e45d1 | 2017-06-01 13:07:39 -0400 | [diff] [blame] | 146 | "renderthread/CacheManager.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
John Reck | 7075c79 | 2017-07-05 14:03:43 -0700 | [diff] [blame] | 206 | "ProfileData.cpp", |
John Reck | 34781b2 | 2017-07-05 16:39:36 -0700 | [diff] [blame] | 207 | "ProfileDataContainer.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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: ["."], |
Colin Cross | 3f8fd40 | 2017-04-20 12:20:20 -0700 | [diff] [blame] | 239 | export_shared_lib_headers: ["libRScpp"], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | cc_library { |
| 243 | name: "libhwui", |
Chris Craik | d17b63c | 2017-06-01 10:45:36 -0700 | [diff] [blame] | 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 | ], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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 | ], |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
Derek Sollenberger | f9e45d1 | 2017-06-01 13:07:39 -0400 | [diff] [blame] | 307 | "tests/unit/CacheManagerTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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", |
Seigo Nonaka | 1f9c461 | 2017-05-01 22:17:36 -0700 | [diff] [blame] | 343 | "tests/unit/TypefaceTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 344 | "tests/unit/VectorDrawableTests.cpp", |
Stan Iliev | 3310fb1 | 2017-03-23 16:56:51 -0400 | [diff] [blame] | 345 | "tests/unit/VectorDrawableAtlasTests.cpp", |
Colin Cross | f629810 | 2017-04-19 15:25:25 -0700 | [diff] [blame] | 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 | } |