Home | History | Annotate | Download | only in hwui
      1 LOCAL_PATH:= $(call my-dir)
      2 include $(CLEAR_VARS)
      3 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
      4 
      5 HWUI_NEW_OPS := true
      6 BUGREPORT_FONT_CACHE_USAGE := false
      7 
      8 # Enables fine-grained GLES error checking
      9 # If set to true, every GLES call is wrapped & error checked
     10 # Has moderate overhead
     11 HWUI_ENABLE_OPENGL_VALIDATION := false
     12 
     13 hwui_src_files := \
     14     font/CacheTexture.cpp \
     15     font/Font.cpp \
     16     hwui/Canvas.cpp \
     17     hwui/MinikinSkia.cpp \
     18     hwui/MinikinUtils.cpp \
     19     hwui/PaintImpl.cpp \
     20     hwui/Typeface.cpp \
     21     renderstate/Blend.cpp \
     22     renderstate/MeshState.cpp \
     23     renderstate/OffscreenBufferPool.cpp \
     24     renderstate/PixelBufferState.cpp \
     25     renderstate/RenderState.cpp \
     26     renderstate/Scissor.cpp \
     27     renderstate/Stencil.cpp \
     28     renderstate/TextureState.cpp \
     29     renderthread/CanvasContext.cpp \
     30     renderthread/DrawFrameTask.cpp \
     31     renderthread/EglManager.cpp \
     32     renderthread/RenderProxy.cpp \
     33     renderthread/RenderTask.cpp \
     34     renderthread/RenderThread.cpp \
     35     renderthread/TimeLord.cpp \
     36     thread/TaskManager.cpp \
     37     utils/Blur.cpp \
     38     utils/GLUtils.cpp \
     39     utils/LinearAllocator.cpp \
     40     utils/NinePatchImpl.cpp \
     41     utils/StringUtils.cpp \
     42     utils/TestWindowContext.cpp \
     43     utils/VectorDrawableUtils.cpp \
     44     AmbientShadow.cpp \
     45     AnimationContext.cpp \
     46     Animator.cpp \
     47     AnimatorManager.cpp \
     48     AssetAtlas.cpp \
     49     Caches.cpp \
     50     CanvasState.cpp \
     51     ClipArea.cpp \
     52     DamageAccumulator.cpp \
     53     DeferredDisplayList.cpp \
     54     DeferredLayerUpdater.cpp \
     55     DeviceInfo.cpp \
     56     DisplayList.cpp \
     57     DisplayListCanvas.cpp \
     58     Dither.cpp \
     59     Extensions.cpp \
     60     FboCache.cpp \
     61     FontRenderer.cpp \
     62     FrameInfo.cpp \
     63     FrameInfoVisualizer.cpp \
     64     GammaFontRenderer.cpp \
     65     GlopBuilder.cpp \
     66     GpuMemoryTracker.cpp \
     67     GradientCache.cpp \
     68     Image.cpp \
     69     Interpolator.cpp \
     70     JankTracker.cpp \
     71     Layer.cpp \
     72     LayerCache.cpp \
     73     LayerRenderer.cpp \
     74     LayerUpdateQueue.cpp \
     75     Matrix.cpp \
     76     OpenGLRenderer.cpp \
     77     Patch.cpp \
     78     PatchCache.cpp \
     79     PathCache.cpp \
     80     PathTessellator.cpp \
     81     PathParser.cpp \
     82     PixelBuffer.cpp \
     83     Program.cpp \
     84     ProgramCache.cpp \
     85     Properties.cpp \
     86     PropertyValuesHolder.cpp \
     87     PropertyValuesAnimatorSet.cpp \
     88     Readback.cpp \
     89     RenderBufferCache.cpp \
     90     RenderNode.cpp \
     91     RenderProperties.cpp \
     92     ResourceCache.cpp \
     93     ShadowTessellator.cpp \
     94     SkiaCanvas.cpp \
     95     SkiaCanvasProxy.cpp \
     96     SkiaShader.cpp \
     97     Snapshot.cpp \
     98     SpotShadow.cpp \
     99     TessellationCache.cpp \
    100     TextDropShadowCache.cpp \
    101     Texture.cpp \
    102     TextureCache.cpp \
    103     VectorDrawable.cpp \
    104     protos/hwui.proto
    105 
    106 hwui_test_common_src_files := \
    107     $(call all-cpp-files-under, tests/common/scenes) \
    108     tests/common/TestContext.cpp \
    109     tests/common/TestScene.cpp \
    110     tests/common/TestUtils.cpp
    111 
    112 hwui_cflags := \
    113     -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
    114     -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
    115     -Wall -Wno-unused-parameter -Wunreachable-code -Werror
    116 
    117 ifeq ($(TARGET_USES_HWC2),true)
    118     hwui_cflags += -DUSE_HWC2
    119 endif
    120 
    121 # GCC false-positives on this warning, and since we -Werror that's
    122 # a problem
    123 hwui_cflags += -Wno-free-nonheap-object
    124 
    125 ifeq (true, $(HWUI_NEW_OPS))
    126     hwui_src_files += \
    127         BakedOpDispatcher.cpp \
    128         BakedOpRenderer.cpp \
    129         BakedOpState.cpp \
    130         FrameBuilder.cpp \
    131         LayerBuilder.cpp \
    132         OpDumper.cpp \
    133         RecordingCanvas.cpp
    134 
    135     hwui_cflags += -DHWUI_NEW_OPS
    136 
    137 endif
    138 
    139 ifeq (true, $(BUGREPORT_FONT_CACHE_USAGE))
    140     hwui_src_files += \
    141         font/FontCacheHistoryTracker.cpp
    142     hwui_cflags += -DBUGREPORT_FONT_CACHE_USAGE
    143 endif
    144 
    145 
    146 ifndef HWUI_COMPILE_SYMBOLS
    147     hwui_cflags += -fvisibility=hidden
    148 endif
    149 
    150 ifdef HWUI_COMPILE_FOR_PERF
    151     # TODO: Non-arm?
    152     hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
    153 endif
    154 
    155 # This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
    156 # which varies depending on what is being built
    157 define hwui_proto_include
    158 $(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
    159 endef
    160 
    161 hwui_c_includes += \
    162     external/skia/include/private \
    163     external/skia/src/core \
    164     external/harfbuzz_ng/src \
    165     external/freetype/include
    166 
    167 ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
    168     hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
    169     hwui_c_includes += \
    170         $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
    171         frameworks/rs/cpp \
    172         frameworks/rs
    173 endif
    174 
    175 ifeq (true, $(HWUI_ENABLE_OPENGL_VALIDATION))
    176     hwui_cflags += -include debug/wrap_gles.h
    177     hwui_src_files += debug/wrap_gles.cpp
    178     hwui_c_includes += frameworks/native/opengl/libs/GLES2
    179     hwui_cflags += -DDEBUG_OPENGL=3
    180 endif
    181 
    182 
    183 # ------------------------
    184 # static library
    185 # ------------------------
    186 
    187 include $(CLEAR_VARS)
    188 
    189 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
    190 LOCAL_MODULE := libhwui_static
    191 LOCAL_CFLAGS := $(hwui_cflags)
    192 LOCAL_SRC_FILES := $(hwui_src_files)
    193 LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
    194 LOCAL_EXPORT_C_INCLUDE_DIRS := \
    195         $(LOCAL_PATH) \
    196         $(hwui_c_includes) \
    197         $(call hwui_proto_include)
    198 
    199 include $(LOCAL_PATH)/hwui_static_deps.mk
    200 include $(BUILD_STATIC_LIBRARY)
    201 
    202 # ------------------------
    203 # static library null gpu
    204 # ------------------------
    205 
    206 include $(CLEAR_VARS)
    207 
    208 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
    209 LOCAL_MODULE := libhwui_static_null_gpu
    210 LOCAL_CFLAGS := \
    211         $(hwui_cflags) \
    212         -DHWUI_NULL_GPU
    213 LOCAL_SRC_FILES := \
    214         $(hwui_src_files) \
    215         debug/nullegl.cpp \
    216         debug/nullgles.cpp
    217 LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
    218 LOCAL_EXPORT_C_INCLUDE_DIRS := \
    219         $(LOCAL_PATH) \
    220         $(hwui_c_includes) \
    221         $(call hwui_proto_include)
    222 
    223 include $(LOCAL_PATH)/hwui_static_deps.mk
    224 include $(BUILD_STATIC_LIBRARY)
    225 
    226 # ------------------------
    227 # shared library
    228 # ------------------------
    229 
    230 include $(CLEAR_VARS)
    231 
    232 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
    233 LOCAL_MODULE := libhwui
    234 LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
    235 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
    236 
    237 include $(LOCAL_PATH)/hwui_static_deps.mk
    238 include $(BUILD_SHARED_LIBRARY)
    239 
    240 # ------------------------
    241 # unit tests
    242 # ------------------------
    243 
    244 include $(CLEAR_VARS)
    245 
    246 LOCAL_MODULE := hwui_unit_tests
    247 LOCAL_MODULE_TAGS := tests
    248 LOCAL_STATIC_LIBRARIES := libhwui_static_null_gpu
    249 LOCAL_SHARED_LIBRARIES := libmemunreachable
    250 LOCAL_CFLAGS := \
    251         $(hwui_cflags) \
    252         -DHWUI_NULL_GPU
    253 
    254 LOCAL_SRC_FILES += \
    255     $(hwui_test_common_src_files) \
    256     tests/unit/main.cpp \
    257     tests/unit/CanvasStateTests.cpp \
    258     tests/unit/ClipAreaTests.cpp \
    259     tests/unit/DamageAccumulatorTests.cpp \
    260     tests/unit/DeviceInfoTests.cpp \
    261     tests/unit/FatVectorTests.cpp \
    262     tests/unit/FontRendererTests.cpp \
    263     tests/unit/GlopBuilderTests.cpp \
    264     tests/unit/GpuMemoryTrackerTests.cpp \
    265     tests/unit/GradientCacheTests.cpp \
    266     tests/unit/LayerUpdateQueueTests.cpp \
    267     tests/unit/LinearAllocatorTests.cpp \
    268     tests/unit/MatrixTests.cpp \
    269     tests/unit/OffscreenBufferPoolTests.cpp \
    270     tests/unit/RenderNodeTests.cpp \
    271     tests/unit/RenderPropertiesTests.cpp \
    272     tests/unit/SkiaBehaviorTests.cpp \
    273     tests/unit/SnapshotTests.cpp \
    274     tests/unit/StringUtilsTests.cpp \
    275     tests/unit/TestUtilsTests.cpp \
    276     tests/unit/TextDropShadowCacheTests.cpp \
    277     tests/unit/VectorDrawableTests.cpp
    278 
    279 ifeq (true, $(HWUI_NEW_OPS))
    280     LOCAL_SRC_FILES += \
    281         tests/unit/BakedOpDispatcherTests.cpp \
    282         tests/unit/BakedOpRendererTests.cpp \
    283         tests/unit/BakedOpStateTests.cpp \
    284         tests/unit/FrameBuilderTests.cpp \
    285         tests/unit/LeakCheckTests.cpp \
    286         tests/unit/OpDumperTests.cpp \
    287         tests/unit/RecordingCanvasTests.cpp \
    288         tests/unit/SkiaCanvasTests.cpp
    289 endif
    290 
    291 include $(LOCAL_PATH)/hwui_static_deps.mk
    292 include $(BUILD_NATIVE_TEST)
    293 
    294 # ------------------------
    295 # Macro-bench app
    296 # ------------------------
    297 
    298 include $(CLEAR_VARS)
    299 
    300 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
    301 LOCAL_MODULE:= hwuitest
    302 LOCAL_MODULE_TAGS := tests
    303 LOCAL_MODULE_CLASS := EXECUTABLES
    304 LOCAL_MULTILIB := both
    305 LOCAL_MODULE_STEM_32 := hwuitest
    306 LOCAL_MODULE_STEM_64 := hwuitest64
    307 LOCAL_CFLAGS := $(hwui_cflags)
    308 
    309 # set to libhwui_static_null_gpu to skip actual GL commands
    310 LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
    311 
    312 LOCAL_SRC_FILES += \
    313     $(hwui_test_common_src_files) \
    314     tests/macrobench/TestSceneRunner.cpp \
    315     tests/macrobench/main.cpp
    316 
    317 include $(LOCAL_PATH)/hwui_static_deps.mk
    318 include $(BUILD_EXECUTABLE)
    319 
    320 # ------------------------
    321 # Micro-bench app
    322 # ---------------------
    323 include $(CLEAR_VARS)
    324 
    325 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
    326 LOCAL_MODULE:= hwuimicro
    327 LOCAL_MODULE_TAGS := tests
    328 LOCAL_MODULE_CLASS := EXECUTABLES
    329 LOCAL_MULTILIB := both
    330 LOCAL_MODULE_STEM_32 := hwuimicro
    331 LOCAL_MODULE_STEM_64 := hwuimicro64
    332 LOCAL_CFLAGS := \
    333         $(hwui_cflags) \
    334         -DHWUI_NULL_GPU
    335 
    336 LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static_null_gpu
    337 LOCAL_STATIC_LIBRARIES := libgoogle-benchmark
    338 
    339 LOCAL_SRC_FILES += \
    340     $(hwui_test_common_src_files) \
    341     tests/microbench/main.cpp \
    342     tests/microbench/DisplayListCanvasBench.cpp \
    343     tests/microbench/FontBench.cpp \
    344     tests/microbench/LinearAllocatorBench.cpp \
    345     tests/microbench/PathParserBench.cpp \
    346     tests/microbench/ShadowBench.cpp \
    347     tests/microbench/TaskManagerBench.cpp
    348 
    349 ifeq (true, $(HWUI_NEW_OPS))
    350     LOCAL_SRC_FILES += \
    351         tests/microbench/FrameBuilderBench.cpp
    352 endif
    353 
    354 include $(LOCAL_PATH)/hwui_static_deps.mk
    355 include $(BUILD_EXECUTABLE)
    356